Skip to content

Commit

Permalink
feat: use object type for jsonb
Browse files Browse the repository at this point in the history
  • Loading branch information
aldis-ameriks committed Oct 29, 2020
1 parent a839f84 commit d12440d
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 93 deletions.
6 changes: 3 additions & 3 deletions lib/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ const typeMapping = {
number: ['int2', 'int4', 'float4', 'float8', 'money', 'oid'],
boolean: ['bool'],
bigint: [],
object: ['json', 'jsonb'],
Date: ['timestamp', 'timestamptz'],
'Array<string>': ['_bpchar', '_char', '_varchar', '_text', '_numeric', '_uuid', '_bytea', '_inet', '_time', '_timetz', '_interval', '_name'],
'Array<number>': ['_int2', '_int4', '_float4', '_float8', '_money', '_oid'],
'Array<boolean>': ['_bool'],
'Array<object>': ['_json', '_jsonb'],
'Array<Date>': ['_timestamp', '_timestamptz'],
'Array<bigint>': [],
'Record<string, any> | Array<Record<string, any>>': ['json', 'jsonb'],
'Array<Record<string, any> | Array<Record<string, any>>>': ['_json', '_jsonb']
'Array<bigint>': []
}

function getTableDefinitions (sql, schema) {
Expand Down
Loading

0 comments on commit d12440d

Please sign in to comment.