introspectron 5.12.0 → 5.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/query.js +5 -1
- package/package.json +4 -4
- package/pg-types.d.ts +2 -0
- package/query.js +5 -1
package/esm/query.js
CHANGED
|
@@ -145,6 +145,7 @@ export const makeIntrospectionQuery = (serverVersionNum, options = {}) => {
|
|
|
145
145
|
rel.oid as "id",
|
|
146
146
|
rel.relname as "name",
|
|
147
147
|
rel.relkind as "classKind",
|
|
148
|
+
${serverVersionNum >= 100000 ? 'rel.relispartition' : 'false'} as "isPartition",
|
|
148
149
|
dsc.description as "description",
|
|
149
150
|
rel.relnamespace as "namespaceId",
|
|
150
151
|
nsp.nspname as "namespaceName",
|
|
@@ -177,7 +178,10 @@ export const makeIntrospectionQuery = (serverVersionNum, options = {}) => {
|
|
|
177
178
|
rel.relpersistence in ('p') and
|
|
178
179
|
-- We don't want classes that will clash with GraphQL (treat them as private)
|
|
179
180
|
rel.relname not like E'\\\\_\\\\_%' and
|
|
180
|
-
|
|
181
|
+
-- \`p\` is a partitioned table: the logical relation callers read and
|
|
182
|
+
-- write. Its child partitions come back too, flagged by
|
|
183
|
+
-- \`isPartition\` so consumers can treat them as storage.
|
|
184
|
+
rel.relkind in ('r', 'p', 'v', 'm', 'c', 'f') and
|
|
181
185
|
($2 is true or not exists(
|
|
182
186
|
select 1
|
|
183
187
|
from pg_catalog.pg_depend
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "introspectron",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.1",
|
|
4
4
|
"description": "introspect your Postgres database and generate an SDK",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@constructive-io/graphql-test": "^5.12.
|
|
32
|
+
"@constructive-io/graphql-test": "^5.12.1",
|
|
33
33
|
"@jest/test-sequencer": "^30.4.1",
|
|
34
34
|
"@types/pg": "^8.20.4",
|
|
35
35
|
"makage": "^0.3.0",
|
|
36
|
-
"pgsql-test": "^5.11.
|
|
36
|
+
"pgsql-test": "^5.11.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"graphql": "16.13.0",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"graphile",
|
|
49
49
|
"constructive"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "ce544846eafd96280fac2607f873960392ae2c89"
|
|
52
52
|
}
|
package/pg-types.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type PgClass = WithTags<{
|
|
|
14
14
|
namespaceName: string;
|
|
15
15
|
typeId?: string;
|
|
16
16
|
classKind?: string;
|
|
17
|
+
/** `pg_class.relispartition`: the class is a partition of a partitioned table. */
|
|
18
|
+
isPartition?: boolean;
|
|
17
19
|
isExtensionConfigurationTable?: boolean;
|
|
18
20
|
namespace?: PgNamespace;
|
|
19
21
|
type?: PgType;
|
package/query.js
CHANGED
|
@@ -148,6 +148,7 @@ const makeIntrospectionQuery = (serverVersionNum, options = {}) => {
|
|
|
148
148
|
rel.oid as "id",
|
|
149
149
|
rel.relname as "name",
|
|
150
150
|
rel.relkind as "classKind",
|
|
151
|
+
${serverVersionNum >= 100000 ? 'rel.relispartition' : 'false'} as "isPartition",
|
|
151
152
|
dsc.description as "description",
|
|
152
153
|
rel.relnamespace as "namespaceId",
|
|
153
154
|
nsp.nspname as "namespaceName",
|
|
@@ -180,7 +181,10 @@ const makeIntrospectionQuery = (serverVersionNum, options = {}) => {
|
|
|
180
181
|
rel.relpersistence in ('p') and
|
|
181
182
|
-- We don't want classes that will clash with GraphQL (treat them as private)
|
|
182
183
|
rel.relname not like E'\\\\_\\\\_%' and
|
|
183
|
-
|
|
184
|
+
-- \`p\` is a partitioned table: the logical relation callers read and
|
|
185
|
+
-- write. Its child partitions come back too, flagged by
|
|
186
|
+
-- \`isPartition\` so consumers can treat them as storage.
|
|
187
|
+
rel.relkind in ('r', 'p', 'v', 'm', 'c', 'f') and
|
|
184
188
|
($2 is true or not exists(
|
|
185
189
|
select 1
|
|
186
190
|
from pg_catalog.pg_depend
|