diff --git a/.changeset/afraid-baboons-hunt.md b/.changeset/afraid-baboons-hunt.md new file mode 100644 index 0000000000..a5b143fd2d --- /dev/null +++ b/.changeset/afraid-baboons-hunt.md @@ -0,0 +1,6 @@ +--- +"@dataplan/pg": patch +--- + +Export `PgRootStep` interface, and improve said interface to support +`placeholder` of a `PgTypedStep` (with no codec necessary). diff --git a/.changeset/chatty-actors-scream.md b/.changeset/chatty-actors-scream.md new file mode 100644 index 0000000000..d71354833f --- /dev/null +++ b/.changeset/chatty-actors-scream.md @@ -0,0 +1,5 @@ +--- +"graphile-build-pg": patch +--- + +Re-export `sql` and `SQL` from `graphile-build-pg`. diff --git a/grafast/dataplan-pg/src/index.ts b/grafast/dataplan-pg/src/index.ts index 0a430e0c52..c72b2445ad 100644 --- a/grafast/dataplan-pg/src/index.ts +++ b/grafast/dataplan-pg/src/index.ts @@ -145,6 +145,7 @@ import type { PgInsertSingleQueryBuilder } from "./steps/pgInsertSingle.ts"; import { pgInsertSingle, PgInsertSingleStep } from "./steps/pgInsertSingle.ts"; import type { PgGroupDetails, + PgRootStep, PgSelectArgumentDigest, PgSelectArgumentRuntimeValue, PgSelectArgumentSpec, @@ -288,6 +289,7 @@ export type { PgResourceParameter, PgResourceUnique, PgResourceUniqueExtensions, + PgRootStep, PgSelectArgumentDigest, PgSelectArgumentRuntimeValue, PgSelectArgumentSpec, diff --git a/grafast/dataplan-pg/src/steps/pgSelect.ts b/grafast/dataplan-pg/src/steps/pgSelect.ts index 5b583c48e9..b288a14c3b 100644 --- a/grafast/dataplan-pg/src/steps/pgSelect.ts +++ b/grafast/dataplan-pg/src/steps/pgSelect.ts @@ -221,6 +221,7 @@ export type PgSelectMode = "normal" | "aggregate" | "mutation"; * but not guaranteed. */ export type PgRootStep = Step & { + placeholder(step: PgTypedStep): SQL; placeholder(step: Step, codec: PgCodec): SQL; deferredSQL($step: Step): SQL; }; diff --git a/graphile-build/graphile-build-pg/src/index.ts b/graphile-build/graphile-build-pg/src/index.ts index 981db15c9a..77829b876b 100644 --- a/graphile-build/graphile-build-pg/src/index.ts +++ b/graphile-build/graphile-build-pg/src/index.ts @@ -191,3 +191,5 @@ export { getWithPgClientFromPgService, withPgClientFromPgService, } from "@dataplan/pg"; +export type { SQL } from "pg-sql2"; +export { sql } from "pg-sql2";