diff --git a/lib/postgres.js b/lib/postgres.js index 8f5efc6..fee2999 100644 --- a/lib/postgres.js +++ b/lib/postgres.js @@ -3,14 +3,14 @@ const postgres = require('postgres') const typeMapping = { - string: ['bpchar', 'char', 'varchar', 'text', 'uuid', 'bytea', 'inet', 'time', 'timetz', 'interval', 'name'], - number: ['int2', 'int4', 'float4', 'float8', 'numeric', 'money', 'oid'], + string: ['bpchar', 'char', 'varchar', 'text', 'numeric', 'uuid', 'bytea', 'inet', 'time', 'timetz', 'interval', 'name'], + number: ['int2', 'int4', 'float4', 'float8', 'money', 'oid'], boolean: ['bool'], bigint: [], object: ['json', 'jsonb'], Date: ['timestamp', 'timestamptz'], - 'Array': ['_bpchar', '_char', '_varchar', '_text', '_uuid', '_bytea', '_inet', '_time', '_timetz', '_interval', '_name'], - 'Array': ['_int2', '_int4', '_float4', '_float8', '_numeric', '_money', '_oid'], + 'Array': ['_bpchar', '_char', '_varchar', '_text', '_numeric', '_uuid', '_bytea', '_inet', '_time', '_timetz', '_interval', '_name'], + 'Array': ['_int2', '_int4', '_float4', '_float8', '_money', '_oid'], 'Array': ['_bool'], 'Array': ['_json', '_jsonb'], 'Array': ['_timestamp', '_timestamptz'], diff --git a/tap-snapshots/test-cli.js-TAP.test.js b/tap-snapshots/test-cli.js-TAP.test.js index 10b94fb..81a4f0c 100644 --- a/tap-snapshots/test-cli.js-TAP.test.js +++ b/tap-snapshots/test-cli.js-TAP.test.js @@ -40,7 +40,7 @@ export interface TypeEntity { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -77,7 +77,7 @@ export interface TypeEntity { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: string | null; id_maximilian: Array; @@ -90,7 +90,7 @@ export interface TypeEntity { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -136,7 +136,7 @@ export interface TypeEntity { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array; @@ -181,7 +181,7 @@ export interface TypeEntity { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -218,7 +218,7 @@ export interface TypeEntity { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: string | null; id_maximilian: Array; @@ -231,7 +231,7 @@ export interface TypeEntity { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -277,7 +277,7 @@ export interface TypeEntity { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array; @@ -321,7 +321,7 @@ export interface TypeEntity { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -358,7 +358,7 @@ export interface TypeEntity { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: bigint | null; id_maximilian: Array; @@ -371,7 +371,7 @@ export interface TypeEntity { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -417,7 +417,7 @@ export interface TypeEntity { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array; @@ -491,7 +491,7 @@ export interface TypeEntity { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -528,7 +528,7 @@ export interface TypeEntity { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: string | null; id_maximilian: Array; @@ -541,7 +541,7 @@ export interface TypeEntity { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -587,7 +587,7 @@ export interface TypeEntity { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array; @@ -632,7 +632,7 @@ export interface TypeEntity { avatar_myah: Array avatar_rozella: Array camelCase: boolean | null - category_amari: number + category_amari: string category_april: Array category_buddy: Array | null category_clementine: number | null @@ -669,7 +669,7 @@ export interface TypeEntity { id_helen: Array | null id_ike: Array id_joan: Array | null - id_karelle: number | null + id_karelle: string | null id_lavern: Date id_margarita: string | null id_maximilian: Array @@ -682,7 +682,7 @@ export interface TypeEntity { name_enoch: number name_jermain: Array | null name_marielle: string | null - name_myrtle: Array | null + name_myrtle: Array | null name_santos: Array name_skye: string | null name_stephanie: boolean @@ -728,7 +728,7 @@ export interface TypeEntity { updatedat_brett: Array | null updatedat_cedrick: Array updatedat_derick: Array - updatedat_eli: Array + updatedat_eli: Array updatedat_ewell: Array updatedat_laura: Array | null updatedat_melody: Array @@ -773,7 +773,7 @@ export interface TypeEntity { avatar_myah: Array avatar_rozella: Array camelCase: boolean | null - category_amari: number + category_amari: string category_april: Array category_buddy: Array | null category_clementine: number | null @@ -810,7 +810,7 @@ export interface TypeEntity { id_helen: Array | null id_ike: Array id_joan: Array | null - id_karelle: number | null + id_karelle: string | null id_lavern: Date id_margarita: string | null id_maximilian: Array @@ -823,7 +823,7 @@ export interface TypeEntity { name_enoch: number name_jermain: Array | null name_marielle: string | null - name_myrtle: Array | null + name_myrtle: Array | null name_santos: Array name_skye: string | null name_stephanie: boolean @@ -869,7 +869,7 @@ export interface TypeEntity { updatedat_brett: Array | null updatedat_cedrick: Array updatedat_derick: Array - updatedat_eli: Array + updatedat_eli: Array updatedat_ewell: Array updatedat_laura: Array | null updatedat_melody: Array @@ -914,7 +914,7 @@ export interface TypeEntity { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -951,7 +951,7 @@ export interface TypeEntity { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: string | null; id_maximilian: Array; @@ -964,7 +964,7 @@ export interface TypeEntity { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -1010,7 +1010,7 @@ export interface TypeEntity { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array; @@ -1055,7 +1055,7 @@ export type TypeEntity = { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -1092,7 +1092,7 @@ export type TypeEntity = { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: string | null; id_maximilian: Array; @@ -1105,7 +1105,7 @@ export type TypeEntity = { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -1151,7 +1151,7 @@ export type TypeEntity = { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array; diff --git a/tap-snapshots/test-postgres.js-TAP.test.js b/tap-snapshots/test-postgres.js-TAP.test.js index 69c7ac6..04af63c 100644 --- a/tap-snapshots/test-postgres.js-TAP.test.js +++ b/tap-snapshots/test-postgres.js-TAP.test.js @@ -617,7 +617,6 @@ Object { "_int4", "_float4", "_float8", - "_numeric", "_money", "_oid", ], @@ -630,6 +629,7 @@ Object { "_char", "_varchar", "_text", + "_numeric", "_uuid", "_bytea", "_inet", @@ -653,7 +653,6 @@ Object { "int4", "float4", "float8", - "numeric", "money", "oid", ], @@ -666,6 +665,7 @@ Object { "char", "varchar", "text", + "numeric", "uuid", "bytea", "inet", @@ -1296,7 +1296,6 @@ Object { "_int4", "_float4", "_float8", - "_numeric", "_money", "_oid", ], @@ -1309,6 +1308,7 @@ Object { "_char", "_varchar", "_text", + "_numeric", "_uuid", "_bytea", "_inet", @@ -1339,7 +1339,6 @@ Object { "int4", "float4", "float8", - "numeric", "money", "oid", ], @@ -1352,6 +1351,7 @@ Object { "char", "varchar", "text", + "numeric", "uuid", "bytea", "inet", @@ -1984,7 +1984,6 @@ Object { "_int4", "_float4", "_float8", - "_numeric", "_money", "_oid", ], @@ -1997,6 +1996,7 @@ Object { "_char", "_varchar", "_text", + "_numeric", "_uuid", "_bytea", "_inet", @@ -2029,7 +2029,6 @@ Object { "int4", "float4", "float8", - "numeric", "money", "oid", ], @@ -2042,6 +2041,7 @@ Object { "char", "varchar", "text", + "numeric", "uuid", "bytea", "inet", @@ -2675,7 +2675,6 @@ Object { "_int4", "_float4", "_float8", - "_numeric", "_money", "_oid", ], @@ -2688,6 +2687,7 @@ Object { "_char", "_varchar", "_text", + "_numeric", "_uuid", "_bytea", "_inet", @@ -2716,7 +2716,6 @@ Object { "int4", "float4", "float8", - "numeric", "money", "oid", ], @@ -2729,6 +2728,7 @@ Object { "char", "varchar", "text", + "numeric", "uuid", "bytea", "inet", @@ -3356,7 +3356,6 @@ Object { "_int4", "_float4", "_float8", - "_numeric", "_money", "_oid", ], @@ -3369,6 +3368,7 @@ Object { "_char", "_varchar", "_text", + "_numeric", "_uuid", "_bytea", "_inet", @@ -3394,7 +3394,6 @@ Object { "int4", "float4", "float8", - "numeric", "money", "oid", ], @@ -3407,6 +3406,7 @@ Object { "char", "varchar", "text", + "numeric", "uuid", "bytea", "inet", diff --git a/tap-snapshots/test-schema-typegen.js-TAP.test.js b/tap-snapshots/test-schema-typegen.js-TAP.test.js index 3603ab0..1516876 100644 --- a/tap-snapshots/test-schema-typegen.js-TAP.test.js +++ b/tap-snapshots/test-schema-typegen.js-TAP.test.js @@ -40,7 +40,7 @@ export interface TypeEntity { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -77,7 +77,7 @@ export interface TypeEntity { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: string | null; id_maximilian: Array; @@ -90,7 +90,7 @@ export interface TypeEntity { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -136,7 +136,7 @@ export interface TypeEntity { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array; @@ -180,7 +180,7 @@ export interface TypeEntity { avatar_myah: Array; avatar_rozella: Array; camelCase: boolean | null; - category_amari: number; + category_amari: string; category_april: Array; category_buddy: Array | null; category_clementine: number | null; @@ -217,7 +217,7 @@ export interface TypeEntity { id_helen: Array | null; id_ike: Array; id_joan: Array | null; - id_karelle: number | null; + id_karelle: string | null; id_lavern: Date; id_margarita: string | null; id_maximilian: Array; @@ -230,7 +230,7 @@ export interface TypeEntity { name_enoch: number; name_jermain: Array | null; name_marielle: string | null; - name_myrtle: Array | null; + name_myrtle: Array | null; name_santos: Array; name_skye: string | null; name_stephanie: boolean; @@ -276,7 +276,7 @@ export interface TypeEntity { updatedat_brett: Array | null; updatedat_cedrick: Array; updatedat_derick: Array; - updatedat_eli: Array; + updatedat_eli: Array; updatedat_ewell: Array; updatedat_laura: Array | null; updatedat_melody: Array;