Interface PostgresTypeParsers

Per-pool decoding of int8, numeric, date and json columns. Each field left out keeps pg's default.

interface PostgresTypeParsers {
    int8?: "string" | "number" | "bigint";
    numeric?: "string" | "number";
    date?: "string" | "date";
    json?: "string" | "parse";
}

Properties

int8?: "string" | "number" | "bigint"

int8 / bigint (OID 20). pg's default is 'string'. 'number' refuses a value past Number.MAX_SAFE_INTEGER.

numeric?: "string" | "number"

numeric / decimal (OID 1700). pg's default is 'string'. 'number' is a double, so it can round.

date?: "string" | "date"

date (OID 1082). pg's default is 'date', a Date at local midnight; 'string' keeps YYYY-MM-DD.

json?: "string" | "parse"

json (OID 114) and jsonb (OID 3802). pg's default is 'parse'; 'string' keeps the text, as SQLite returns it.