Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions generator/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ services:
timeout: 5s
retries: 5

postgres-14:
image: postgres:14-alpine
environment:
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 5

generator:
image: node:20-alpine
working_dir: /app
command: node generator/generate.js
depends_on:
postgres-11:
condition: service_healthy
postgres-14:
condition: service_healthy
volumes:
- ../:/app
environment:
Expand Down
4 changes: 2 additions & 2 deletions generator/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ const query = `
SELECT json_object_agg(UPPER(PT.typname), PT.oid::int4 ORDER BY pt.oid)
FROM pg_type PT
WHERE typnamespace = (SELECT pgn.oid FROM pg_namespace pgn WHERE nspname = 'pg_catalog') -- Take only builting Postgres types with stable OID (extension types are not guaranted to be stable)
AND typtype = 'b' -- Only basic types
AND typtype IN ('b', 'r', 'm') -- Only basic (b), range (r), and multirange (m) types
AND typelem = 0 -- Ignore aliases
AND typisdefined -- Ignore undefined types
`

const postgresVersions = ['11']
const postgresVersions = ['11', '14']

async function queryPostgresVersion (version) {
const host = `postgres-${version}`
Expand Down
25 changes: 22 additions & 3 deletions lib/builtins.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ DO NOT EDIT THIS FILE BY HAND!
This file is generated automatically by the generator in generator/generate.js
To modify the types, edit the generator script and run: npm run generate

Generated by querying PostgreSQL 11 to ensure comprehensive
Generated by querying PostgreSQL 11, 14 to ensure comprehensive
type coverage for parsing.

Query used:
SELECT json_object_agg(UPPER(PT.typname), PT.oid::int4 ORDER BY pt.oid)
FROM pg_type PT
WHERE typnamespace = (SELECT pgn.oid FROM pg_namespace pgn WHERE nspname = 'pg_catalog') -- Take only builting Postgres types with stable OID (extension types are not guaranted to be stable)
AND typtype = 'b' -- Only basic types
AND typtype IN ('b', 'r', 'm') -- Only basic (b), range (r), and multirange (m) types
AND typelem = 0 -- Ignore aliases
AND typisdefined -- Ignore undefined types
*/
Expand Down Expand Up @@ -76,6 +76,25 @@ export enum builtins {
REGCONFIG = 3734,
REGDICTIONARY = 3769,
JSONB = 3802,
INT4RANGE = 3904,
NUMRANGE = 3906,
TSRANGE = 3908,
TSTZRANGE = 3910,
DATERANGE = 3912,
INT8RANGE = 3926,
JSONPATH = 4072,
REGNAMESPACE = 4089,
REGROLE = 4096
REGROLE = 4096,
REGCOLLATION = 4191,
INT4MULTIRANGE = 4451,
NUMMULTIRANGE = 4532,
TSMULTIRANGE = 4533,
TSTZMULTIRANGE = 4534,
DATEMULTIRANGE = 4535,
INT8MULTIRANGE = 4536,
PG_BRIN_BLOOM_SUMMARY = 4600,
PG_BRIN_MINMAX_MULTI_SUMMARY = 4601,
PG_MCV_LIST = 5017,
PG_SNAPSHOT = 5038,
XID8 = 5069
}
25 changes: 22 additions & 3 deletions lib/builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ DO NOT EDIT THIS FILE BY HAND!
This file is generated automatically by the generator in generator/generate.js
To modify the types, edit the generator script and run: npm run generate

Generated by querying PostgreSQL 11 to ensure comprehensive
Generated by querying PostgreSQL 11, 14 to ensure comprehensive
type coverage for parsing.

Query used:
SELECT json_object_agg(UPPER(PT.typname), PT.oid::int4 ORDER BY pt.oid)
FROM pg_type PT
WHERE typnamespace = (SELECT pgn.oid FROM pg_namespace pgn WHERE nspname = 'pg_catalog') -- Take only builting Postgres types with stable OID (extension types are not guaranted to be stable)
AND typtype = 'b' -- Only basic types
AND typtype IN ('b', 'r', 'm') -- Only basic (b), range (r), and multirange (m) types
AND typelem = 0 -- Ignore aliases
AND typisdefined -- Ignore undefined types
*/
Expand Down Expand Up @@ -76,6 +76,25 @@ module.exports = {
REGCONFIG: 3734,
REGDICTIONARY: 3769,
JSONB: 3802,
INT4RANGE: 3904,
NUMRANGE: 3906,
TSRANGE: 3908,
TSTZRANGE: 3910,
DATERANGE: 3912,
INT8RANGE: 3926,
JSONPATH: 4072,
REGNAMESPACE: 4089,
REGROLE: 4096
REGROLE: 4096,
REGCOLLATION: 4191,
INT4MULTIRANGE: 4451,
NUMMULTIRANGE: 4532,
TSMULTIRANGE: 4533,
TSTZMULTIRANGE: 4534,
DATEMULTIRANGE: 4535,
INT8MULTIRANGE: 4536,
PG_BRIN_BLOOM_SUMMARY: 4600,
PG_BRIN_MINMAX_MULTI_SUMMARY: 4601,
PG_MCV_LIST: 5017,
PG_SNAPSHOT: 5038,
XID8: 5069
}