Skip to content

Commit d901d40

Browse files
authored
Merge pull request #1409 from constructive-io/feat/pg18-parser-stack
feat: upgrade parser stack to PG18 (pgsql-parser 18.1.1, libpg-query 18.1.2)
2 parents 54395e7 + 5cccf91 commit d901d40

84 files changed

Lines changed: 11687 additions & 8375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

graphile/graphile-bucket-provisioner-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "graphile-bucket-provisioner-plugin",
33
"version": "0.14.0",
4-
"description": "Bucket provisioning plugin for PostGraphile v5 auto-provisions S3 buckets on bucket table mutations",
4+
"description": "Bucket provisioning plugin for PostGraphile v5 \u2014 auto-provisions S3 buckets on bucket table mutations",
55
"author": "Constructive <developers@constructive.io>",
66
"homepage": "https://github.com/constructive-io/constructive",
77
"license": "MIT",
@@ -42,7 +42,7 @@
4242
"dependencies": {
4343
"@constructive-io/bucket-provisioner": "workspace:^",
4444
"@pgpmjs/logger": "workspace:^",
45-
"@pgsql/quotes": "^17.1.0"
45+
"@pgsql/quotes": "^18.1.0"
4646
},
4747
"peerDependencies": {
4848
"grafast": "1.0.2",

graphile/graphile-presigned-url-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "graphile-presigned-url-plugin",
33
"version": "0.22.1",
4-
"description": "Presigned URL upload plugin for PostGraphile v5 requestUploadUrl mutation and downloadUrl computed field",
4+
"description": "Presigned URL upload plugin for PostGraphile v5 \u2014 requestUploadUrl mutation and downloadUrl computed field",
55
"author": "Constructive <developers@constructive.io>",
66
"homepage": "https://github.com/constructive-io/constructive",
77
"license": "MIT",
@@ -43,7 +43,7 @@
4343
"@aws-sdk/client-s3": "^3.1052.0",
4444
"@aws-sdk/s3-request-presigner": "^3.1052.0",
4545
"@pgpmjs/logger": "workspace:^",
46-
"@pgsql/quotes": "^17.1.0",
46+
"@pgsql/quotes": "^18.1.0",
4747
"lru-cache": "^11.2.7"
4848
},
4949
"peerDependencies": {

graphile/graphile-realtime-subscriptions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "graphile-realtime-subscriptions",
33
"version": "0.10.0",
4-
"description": "Realtime subscription plugin for PostGraphile v5 per-table GraphQL subscriptions via LISTEN/NOTIFY",
4+
"description": "Realtime subscription plugin for PostGraphile v5 \u2014 per-table GraphQL subscriptions via LISTEN/NOTIFY",
55
"author": "Constructive <developers@constructive.io>",
66
"homepage": "https://github.com/constructive-io/constructive",
77
"license": "MIT",
@@ -41,7 +41,7 @@
4141
},
4242
"dependencies": {
4343
"@pgpmjs/logger": "workspace:^",
44-
"@pgsql/quotes": "^17.1.0"
44+
"@pgsql/quotes": "^18.1.0"
4545
},
4646
"peerDependencies": {
4747
"grafast": "1.0.2",

graphile/graphile-settings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@graphile-contrib/pg-many-to-many": "2.0.0-rc.2",
4242
"@pgpmjs/logger": "workspace:^",
4343
"@pgpmjs/types": "workspace:^",
44-
"@pgsql/quotes": "^17.1.0",
44+
"@pgsql/quotes": "^18.1.0",
4545
"cors": "^2.8.6",
4646
"express": "^5.2.1",
4747
"grafast": "1.0.2",

graphile/graphile-sql-expression-validator/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"url": "https://github.com/constructive-io/constructive/issues"
4343
},
4444
"dependencies": {
45-
"pgsql-deparser": "^17.18.5",
46-
"pgsql-parser": "^17.9.17"
45+
"pgsql-deparser": "^18.1.1",
46+
"pgsql-parser": "^18.1.1"
4747
},
4848
"peerDependencies": {
4949
"grafast": "1.0.2",

graphile/graphile-sql-expression-validator/src/validator.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ export async function parseAndValidateSqlExpression(
382382
}
383383

384384
const stmt = parseResult.stmts[0]?.stmt;
385-
if (!stmt?.SelectStmt) {
385+
if (!stmt || !('SelectStmt' in stmt) || !stmt.SelectStmt) {
386386
return { valid: false, error: 'Unexpected parse result structure' };
387387
}
388388

@@ -394,7 +394,7 @@ export async function parseAndValidateSqlExpression(
394394
'lockingClause', 'distinctClause'
395395
];
396396
for (const dangerousKey of DANGEROUS_SELECT_KEYS) {
397-
if (selectStmt[dangerousKey] !== undefined) {
397+
if ((selectStmt as Record<string, unknown>)[dangerousKey] !== undefined) {
398398
return {
399399
valid: false,
400400
error: `Expression contains disallowed SQL clause: ${dangerousKey}`
@@ -407,7 +407,8 @@ export async function parseAndValidateSqlExpression(
407407
return { valid: false, error: 'Expected single expression' };
408408
}
409409

410-
const resTarget = targetList[0]?.ResTarget;
410+
const targetNode = targetList[0];
411+
const resTarget = targetNode && 'ResTarget' in targetNode ? targetNode.ResTarget : undefined;
411412
if (!resTarget || !resTarget.val) {
412413
return {
413414
valid: false,

graphql/orm-test/__generated__/m2n/client.js

Lines changed: 147 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

graphql/orm-test/__generated__/m2n/index.js

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

graphql/orm-test/__generated__/m2n/input-types.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

graphql/orm-test/__generated__/m2n/models/index.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)