@prisma-next/extension-paradedb 0.11.0-dev.6 → 0.11.0-dev.61
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/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +3 -7
- package/dist/control.mjs.map +1 -1
- package/dist/descriptor-meta-CPQfeTa-.mjs.map +1 -1
- package/dist/index-types-BZqoAhWT.mjs.map +1 -1
- package/dist/index-types.d.mts.map +1 -1
- package/dist/operation-types-DXmTJ7jd.d.mts.map +1 -1
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs.map +1 -1
- package/package.json +18 -18
- package/src/contract.d.ts +32 -24
- package/src/contract.json +2 -0
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts","../src/exports/control.ts"],"mappings":";;;;cAmMa,gBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cCzIP,2BAAA,EAA6B,
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts","../src/exports/control.ts"],"mappings":";;;;cAmMa,gBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cCzIP,2BAAA,EAA6B,6BAA6B"}
|
package/dist/control.mjs
CHANGED
|
@@ -20,6 +20,7 @@ const paradedbContractSpace = contractSpaceFromJson({
|
|
|
20
20
|
},
|
|
21
21
|
capabilities: {
|
|
22
22
|
"postgres": {
|
|
23
|
+
"distinctOn": true,
|
|
23
24
|
"jsonAgg": true,
|
|
24
25
|
"lateral": true,
|
|
25
26
|
"limit": true,
|
|
@@ -29,6 +30,7 @@ const paradedbContractSpace = contractSpaceFromJson({
|
|
|
29
30
|
"sql": {
|
|
30
31
|
"defaultInInsert": true,
|
|
31
32
|
"enums": true,
|
|
33
|
+
"lateral": true,
|
|
32
34
|
"returning": true
|
|
33
35
|
}
|
|
34
36
|
},
|
|
@@ -45,15 +47,9 @@ const paradedbContractSpace = contractSpaceFromJson({
|
|
|
45
47
|
metadata: {
|
|
46
48
|
from: null,
|
|
47
49
|
to: "sha256:59877923532fc526703f572f1d54bdd6050502ef30ede3333ee1393ea93b9716",
|
|
48
|
-
labels: [],
|
|
49
50
|
providedInvariants: ["paradedb:install-pg-search-v1"],
|
|
50
51
|
createdAt: "2026-06-01T00:00:00.000Z",
|
|
51
|
-
|
|
52
|
-
"used": [],
|
|
53
|
-
"applied": [],
|
|
54
|
-
"plannerVersion": "2.0.0"
|
|
55
|
-
},
|
|
56
|
-
migrationHash: "sha256:b5e39b2ca76fcf9fb4fc0cb989c702549d984d09236742ad950658b7ed05bdc3"
|
|
52
|
+
migrationHash: "sha256:b1b0a426b92236d755c27a1e961b05382f11438155ae95838fc4b08eb98942af"
|
|
57
53
|
},
|
|
58
54
|
ops: [{
|
|
59
55
|
"id": "paradedb.install-pg-search-extension",
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_pg_search_extension/migration.json","../migrations/20260601T0000_install_pg_search_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Control-plane descriptor for the paradedb extension.\n *\n * **Contract-space package layout.** The extension's contract\n * + migrations are emitted by the same pipeline application authors use:\n *\n * `prisma-next contract emit` → `<package>/src/contract.{json,d.ts}`\n * `prisma-next migration plan` → `<package>/migrations/<dir>/...`\n *\n * The descriptor wires those JSON artefacts via JSON-import declarations\n * so they flow through the consuming application's module resolver\n * without filesystem assumptions, and synthesises the canonical\n * {@link import('@prisma-next/framework-components/control').MigrationPackage}\n * shape for the framework's runner / verifier to consume. Readers in\n * `@prisma-next/migration-tools` add `dirPath` when loading from disk\n * (`OnDiskMigrationPackage`); descriptor-bundled packages do not need\n * it because the framework reads them directly from the descriptor.\n *\n * Wired surfaces:\n *\n * - `contractSpace.{contractJson,migrations,headRef}` — sourced from\n * the on-disk artefacts emitted by `build:contract-space`.\n * - `queryOperations` — BM25 full-text search operations registered\n * via `paradedbQueryOperations()`.\n *\n * @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n * (contract-space package layout convention).\n */\n\nimport type { Contract } from '@prisma-next/contract/types';\nimport type { SqlControlExtensionDescriptor } from '@prisma-next/family-sql/control';\nimport { contractSpaceFromJson } from '@prisma-next/migration-tools/spaces';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport baselineMetadata from '../../migrations/20260601T0000_install_pg_search_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_pg_search_extension/ops.json' with {\n type: 'json',\n};\nimport headRef from '../../migrations/refs/head.json' with { type: 'json' };\nimport contractJson from '../contract.json' with { type: 'json' };\nimport { PARADEDB_SPACE_ID } from '../core/constants';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst BASELINE_DIR_NAME = '20260601T0000_install_pg_search_extension';\n\nconst paradedbContractSpace = contractSpaceFromJson<Contract<SqlStorage>>({\n contractJson,\n migrations: [\n {\n dirName: BASELINE_DIR_NAME,\n metadata: baselineMetadata,\n ops: baselineOps,\n },\n ],\n headRef,\n});\n\nconst paradedbExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...paradedbPackMeta,\n id: PARADEDB_SPACE_ID,\n contractSpace: paradedbContractSpace,\n queryOperations: () => paradedbQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { paradedbExtensionDescriptor, paradedbPackMeta };\nexport default paradedbExtensionDescriptor;\n"],"mappings":";;;;AI8CA,MAAM,wBAAwB,sBAA4C;CACxE,cAAA
|
|
1
|
+
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_pg_search_extension/migration.json","../migrations/20260601T0000_install_pg_search_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Control-plane descriptor for the paradedb extension.\n *\n * **Contract-space package layout.** The extension's contract\n * + migrations are emitted by the same pipeline application authors use:\n *\n * `prisma-next contract emit` → `<package>/src/contract.{json,d.ts}`\n * `prisma-next migration plan` → `<package>/migrations/<dir>/...`\n *\n * The descriptor wires those JSON artefacts via JSON-import declarations\n * so they flow through the consuming application's module resolver\n * without filesystem assumptions, and synthesises the canonical\n * {@link import('@prisma-next/framework-components/control').MigrationPackage}\n * shape for the framework's runner / verifier to consume. Readers in\n * `@prisma-next/migration-tools` add `dirPath` when loading from disk\n * (`OnDiskMigrationPackage`); descriptor-bundled packages do not need\n * it because the framework reads them directly from the descriptor.\n *\n * Wired surfaces:\n *\n * - `contractSpace.{contractJson,migrations,headRef}` — sourced from\n * the on-disk artefacts emitted by `build:contract-space`.\n * - `queryOperations` — BM25 full-text search operations registered\n * via `paradedbQueryOperations()`.\n *\n * @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n * (contract-space package layout convention).\n */\n\nimport type { Contract } from '@prisma-next/contract/types';\nimport type { SqlControlExtensionDescriptor } from '@prisma-next/family-sql/control';\nimport { contractSpaceFromJson } from '@prisma-next/migration-tools/spaces';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport baselineMetadata from '../../migrations/20260601T0000_install_pg_search_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_pg_search_extension/ops.json' with {\n type: 'json',\n};\nimport headRef from '../../migrations/refs/head.json' with { type: 'json' };\nimport contractJson from '../contract.json' with { type: 'json' };\nimport { PARADEDB_SPACE_ID } from '../core/constants';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst BASELINE_DIR_NAME = '20260601T0000_install_pg_search_extension';\n\nconst paradedbContractSpace = contractSpaceFromJson<Contract<SqlStorage>>({\n contractJson,\n migrations: [\n {\n dirName: BASELINE_DIR_NAME,\n metadata: baselineMetadata,\n ops: baselineOps,\n },\n ],\n headRef,\n});\n\nconst paradedbExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...paradedbPackMeta,\n id: PARADEDB_SPACE_ID,\n contractSpace: paradedbContractSpace,\n queryOperations: () => paradedbQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { paradedbExtensionDescriptor, paradedbPackMeta };\nexport default paradedbExtensionDescriptor;\n"],"mappings":";;;;AI8CA,MAAM,wBAAwB,sBAA4C;CACxE,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;;;;;;EAAAA;EACV,KAAKC;;;;;;;;;;;;;;;;;;;;;;;;;GAAAA;CACP,CACF;CACA,SAAA;;;CAAA;AACF,CAAC;AAED,MAAM,8BAAyE;CAC7E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,uBAAuB,wBAAwB;CAC/C,eAAe;EACb,UAAU;EACV,UAAU;CACZ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-CPQfeTa-.mjs","names":["TEXT","TEXT_REF"],"sources":["../src/core/constants.ts","../src/core/proximity-chain.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["/**\n * Extension ID for ParadeDB pg_search.\n */\nexport const PARADEDB_EXTENSION_ID = 'paradedb' as const;\n\n/**\n * Static names and identifiers used across paradedb's contract space.\n *\n * Centralised here so the contract IR (`./contract`), the baseline\n * migration ops (`./migrations`), the head ref, and the descriptor\n * (`../exports/control`) all reference the same values without typos.\n *\n * The space identifier `'paradedb'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for paradedb-owned rows.\n *\n * The `paradedb:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\nexport const PARADEDB_SPACE_ID = 'paradedb' as const;\n\nexport const PARADEDB_BASELINE_MIGRATION_NAME =\n '20260601T0000_install_pg_search_extension' as const;\n\n/**\n * `paradedb:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers reference them by\n * literal string match.\n */\nexport const PARADEDB_INVARIANTS = {\n installPgSearch: 'paradedb:install-pg-search-v1',\n} as const;\n","import {\n type AnyExpression,\n LiteralExpr,\n OperationExpr,\n} from '@prisma-next/sql-relational-core/ast';\nimport { type Expression, toExpr } from '@prisma-next/sql-relational-core/expression';\n\nconst TEXT = 'pg/text@1' as const;\nconst TEXT_REF = { codecId: TEXT } as const;\n\nexport type ProximityTerm = unknown;\n\nexport interface ProximityWithinOptions {\n readonly ordered?: boolean;\n}\n\ninterface ProximityStep {\n readonly distance: number;\n readonly term: ProximityTerm;\n readonly ordered: boolean;\n}\n\n// https://docs.paradedb.com/documentation/full-text/proximity\nexport class ParadeDbProximityChain\n implements Expression<{ codecId: 'pg/text@1'; nullable: false }>\n{\n readonly returnType = { codecId: TEXT, nullable: false } as const;\n\n private readonly start: ProximityTerm;\n private readonly steps: readonly ProximityStep[];\n\n constructor(start: ProximityTerm, steps: readonly ProximityStep[] = []) {\n this.start = start;\n this.steps = steps;\n }\n\n within(\n distance: number,\n term: ProximityTerm,\n options?: ProximityWithinOptions,\n ): ParadeDbProximityChain {\n if (!Number.isInteger(distance) || distance < 0) {\n throw new Error(\n `paradeDbProximity.within: distance must be a non-negative integer; got ${String(distance)}`,\n );\n }\n return new ParadeDbProximityChain(this.start, [\n ...this.steps,\n { distance, term, ordered: options?.ordered === true },\n ]);\n }\n\n buildAst(): AnyExpression {\n if (this.steps.length === 0) {\n throw new Error(\n 'paradeDbProximity: chain must have at least one .within(distance, term) step',\n );\n }\n const args: AnyExpression[] = [toExpr(this.start, TEXT_REF)];\n let template = '({{self}}';\n this.steps.forEach((step, i) => {\n const op = step.ordered ? '##>' : '##';\n args.push(LiteralExpr.of(step.distance));\n args.push(toExpr(step.term, TEXT_REF));\n template += ` ${op} {{arg${2 * i}}} ${op} {{arg${2 * i + 1}}}`;\n });\n template += ')';\n const [self, ...rest] = args;\n if (!self) {\n throw new Error('paradeDbProximity: invariant violation — empty args');\n }\n return new OperationExpr({\n method: 'paradeDbProximity',\n self,\n args: rest.length > 0 ? rest : undefined,\n returns: this.returnType,\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template,\n },\n });\n }\n}\n","import { LiteralExpr } from '@prisma-next/sql-relational-core/ast';\nimport { buildOperation, toExpr } from '@prisma-next/sql-relational-core/expression';\nimport { paradedbIndexTypes } from '../types/index-types';\nimport type { QueryOperationTypes } from '../types/operation-types';\nimport { PARADEDB_EXTENSION_ID } from './constants';\nimport { ParadeDbProximityChain } from './proximity-chain';\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\nconst TEXT = 'pg/text@1' as const;\nconst BOOL = 'pg/bool@1' as const;\nconst FLOAT4 = 'pg/float4@1' as const;\nconst INT4 = 'pg/int4@1' as const;\n\nconst TEXT_REF = { codecId: TEXT } as const;\nconst INT4_REF = { codecId: INT4 } as const;\n\nexport function paradedbQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n return {\n // `@@@` accepts both text and structured query types on its RHS.\n // https://docs.paradedb.com/documentation/full-text/match\n paradeDbMatch: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatch',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} @@@ {{arg0}}',\n },\n }),\n },\n paradeDbMatchAny: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAny',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ||| {{arg0}}',\n },\n }),\n },\n paradeDbMatchAll: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAll',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} &&& {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/term\n paradeDbTerm: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbTerm',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} === {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/phrase\n paradeDbPhrase: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbPhrase',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ### {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/sorting/score\n paradeDbScore: {\n self: { codecId: INT4 },\n impl: (self) =>\n buildOperation({\n method: 'paradeDbScore',\n args: [toExpr(self, INT4_REF)],\n returns: { codecId: FLOAT4, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: 'pdb.score({{self}})',\n },\n }),\n },\n // PG rejects parameterized typmods, so the cast argument lowers to a literal.\n // https://docs.paradedb.com/documentation/full-text/fuzzy\n paradeDbFuzzy: {\n self: { codecId: TEXT },\n impl: (self, distance) => {\n if (!Number.isInteger(distance) || distance < 0 || distance > 2) {\n throw new Error(\n `paradeDbFuzzy: distance must be an integer in [0, 2]; got ${String(distance)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbFuzzy',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(distance)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.fuzzy({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/sorting/boost\n paradeDbBoost: {\n self: { codecId: TEXT },\n impl: (self, weight) => {\n if (!Number.isInteger(weight) || weight < -2048 || weight > 2048) {\n throw new Error(\n `paradeDbBoost: boost must be an integer in [-2048, 2048]; got ${String(weight)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbBoost',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(weight)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.boost({{arg0}})',\n },\n });\n },\n },\n paradeDbConst: {\n self: { codecId: TEXT },\n impl: (self, value) => {\n if (!Number.isInteger(value)) {\n throw new Error(`paradeDbConst: value must be an integer; got ${String(value)}`);\n }\n return buildOperation({\n method: 'paradeDbConst',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(value)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.const({{arg0}})',\n },\n });\n },\n },\n paradeDbSlop: {\n self: { codecId: TEXT },\n impl: (self, slop) => {\n if (!Number.isInteger(slop) || slop < 0) {\n throw new Error(`paradeDbSlop: slop must be a non-negative integer; got ${String(slop)}`);\n }\n return buildOperation({\n method: 'paradeDbSlop',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(slop)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.slop({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/full-text/proximity\n paradeDbProximity: {\n self: { codecId: TEXT },\n impl: (start) => new ParadeDbProximityChain(start),\n },\n };\n}\n\nexport const paradedbPackMeta = {\n kind: 'extension',\n id: PARADEDB_EXTENSION_ID,\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'paradedb/bm25': true,\n },\n },\n indexTypes: paradedbIndexTypes,\n types: {\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-paradedb/operation-types',\n named: 'QueryOperationTypes',\n alias: 'ParadeDbQueryOperationTypes',\n },\n },\n },\n} as const;\n"],"mappings":";;;;;;;AAGA,MAAa,wBAAwB;;;;;;;;;;;;;;;;AAiBrC,MAAa,oBAAoB;;;ACbjC,MAAMA,SAAO;AACb,MAAMC,aAAW,EAAE,SAASD,QAAM;AAelC,IAAa,yBAAb,MAAa,uBAEb;CACE,aAAsB;EAAE,SAASA;EAAM,UAAU;EAAO;CAExD;CACA;CAEA,YAAY,OAAsB,QAAkC,EAAE,EAAE;EACtE,KAAK,QAAQ;EACb,KAAK,QAAQ;;CAGf,OACE,UACA,MACA,SACwB;EACxB,IAAI,CAAC,OAAO,UAAU,SAAS,IAAI,WAAW,GAC5C,MAAM,IAAI,MACR,0EAA0E,OAAO,SAAS,GAC3F;EAEH,OAAO,IAAI,uBAAuB,KAAK,OAAO,CAC5C,GAAG,KAAK,OACR;GAAE;GAAU;GAAM,SAAS,SAAS,YAAY;GAAM,CACvD,CAAC;;CAGJ,WAA0B;EACxB,IAAI,KAAK,MAAM,WAAW,GACxB,MAAM,IAAI,MACR,+EACD;EAEH,MAAM,OAAwB,CAAC,OAAO,KAAK,OAAOC,WAAS,CAAC;EAC5D,IAAI,WAAW;EACf,KAAK,MAAM,SAAS,MAAM,MAAM;GAC9B,MAAM,KAAK,KAAK,UAAU,QAAQ;GAClC,KAAK,KAAK,YAAY,GAAG,KAAK,SAAS,CAAC;GACxC,KAAK,KAAK,OAAO,KAAK,MAAMA,WAAS,CAAC;GACtC,YAAY,IAAI,GAAG,QAAQ,IAAI,EAAE,KAAK,GAAG,QAAQ,IAAI,IAAI,EAAE;IAC3D;EACF,YAAY;EACZ,MAAM,CAAC,MAAM,GAAG,QAAQ;EACxB,IAAI,C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}
|
|
1
|
+
{"version":3,"file":"descriptor-meta-CPQfeTa-.mjs","names":["TEXT","TEXT_REF"],"sources":["../src/core/constants.ts","../src/core/proximity-chain.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["/**\n * Extension ID for ParadeDB pg_search.\n */\nexport const PARADEDB_EXTENSION_ID = 'paradedb' as const;\n\n/**\n * Static names and identifiers used across paradedb's contract space.\n *\n * Centralised here so the contract IR (`./contract`), the baseline\n * migration ops (`./migrations`), the head ref, and the descriptor\n * (`../exports/control`) all reference the same values without typos.\n *\n * The space identifier `'paradedb'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for paradedb-owned rows.\n *\n * The `paradedb:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\nexport const PARADEDB_SPACE_ID = 'paradedb' as const;\n\nexport const PARADEDB_BASELINE_MIGRATION_NAME =\n '20260601T0000_install_pg_search_extension' as const;\n\n/**\n * `paradedb:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers reference them by\n * literal string match.\n */\nexport const PARADEDB_INVARIANTS = {\n installPgSearch: 'paradedb:install-pg-search-v1',\n} as const;\n","import {\n type AnyExpression,\n LiteralExpr,\n OperationExpr,\n} from '@prisma-next/sql-relational-core/ast';\nimport { type Expression, toExpr } from '@prisma-next/sql-relational-core/expression';\n\nconst TEXT = 'pg/text@1' as const;\nconst TEXT_REF = { codecId: TEXT } as const;\n\nexport type ProximityTerm = unknown;\n\nexport interface ProximityWithinOptions {\n readonly ordered?: boolean;\n}\n\ninterface ProximityStep {\n readonly distance: number;\n readonly term: ProximityTerm;\n readonly ordered: boolean;\n}\n\n// https://docs.paradedb.com/documentation/full-text/proximity\nexport class ParadeDbProximityChain\n implements Expression<{ codecId: 'pg/text@1'; nullable: false }>\n{\n readonly returnType = { codecId: TEXT, nullable: false } as const;\n\n private readonly start: ProximityTerm;\n private readonly steps: readonly ProximityStep[];\n\n constructor(start: ProximityTerm, steps: readonly ProximityStep[] = []) {\n this.start = start;\n this.steps = steps;\n }\n\n within(\n distance: number,\n term: ProximityTerm,\n options?: ProximityWithinOptions,\n ): ParadeDbProximityChain {\n if (!Number.isInteger(distance) || distance < 0) {\n throw new Error(\n `paradeDbProximity.within: distance must be a non-negative integer; got ${String(distance)}`,\n );\n }\n return new ParadeDbProximityChain(this.start, [\n ...this.steps,\n { distance, term, ordered: options?.ordered === true },\n ]);\n }\n\n buildAst(): AnyExpression {\n if (this.steps.length === 0) {\n throw new Error(\n 'paradeDbProximity: chain must have at least one .within(distance, term) step',\n );\n }\n const args: AnyExpression[] = [toExpr(this.start, TEXT_REF)];\n let template = '({{self}}';\n this.steps.forEach((step, i) => {\n const op = step.ordered ? '##>' : '##';\n args.push(LiteralExpr.of(step.distance));\n args.push(toExpr(step.term, TEXT_REF));\n template += ` ${op} {{arg${2 * i}}} ${op} {{arg${2 * i + 1}}}`;\n });\n template += ')';\n const [self, ...rest] = args;\n if (!self) {\n throw new Error('paradeDbProximity: invariant violation — empty args');\n }\n return new OperationExpr({\n method: 'paradeDbProximity',\n self,\n args: rest.length > 0 ? rest : undefined,\n returns: this.returnType,\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template,\n },\n });\n }\n}\n","import { LiteralExpr } from '@prisma-next/sql-relational-core/ast';\nimport { buildOperation, toExpr } from '@prisma-next/sql-relational-core/expression';\nimport { paradedbIndexTypes } from '../types/index-types';\nimport type { QueryOperationTypes } from '../types/operation-types';\nimport { PARADEDB_EXTENSION_ID } from './constants';\nimport { ParadeDbProximityChain } from './proximity-chain';\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\nconst TEXT = 'pg/text@1' as const;\nconst BOOL = 'pg/bool@1' as const;\nconst FLOAT4 = 'pg/float4@1' as const;\nconst INT4 = 'pg/int4@1' as const;\n\nconst TEXT_REF = { codecId: TEXT } as const;\nconst INT4_REF = { codecId: INT4 } as const;\n\nexport function paradedbQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n return {\n // `@@@` accepts both text and structured query types on its RHS.\n // https://docs.paradedb.com/documentation/full-text/match\n paradeDbMatch: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatch',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} @@@ {{arg0}}',\n },\n }),\n },\n paradeDbMatchAny: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAny',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ||| {{arg0}}',\n },\n }),\n },\n paradeDbMatchAll: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAll',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} &&& {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/term\n paradeDbTerm: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbTerm',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} === {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/phrase\n paradeDbPhrase: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbPhrase',\n args: [toExpr(self, TEXT_REF), toExpr(query, TEXT_REF)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ### {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/sorting/score\n paradeDbScore: {\n self: { codecId: INT4 },\n impl: (self) =>\n buildOperation({\n method: 'paradeDbScore',\n args: [toExpr(self, INT4_REF)],\n returns: { codecId: FLOAT4, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: 'pdb.score({{self}})',\n },\n }),\n },\n // PG rejects parameterized typmods, so the cast argument lowers to a literal.\n // https://docs.paradedb.com/documentation/full-text/fuzzy\n paradeDbFuzzy: {\n self: { codecId: TEXT },\n impl: (self, distance) => {\n if (!Number.isInteger(distance) || distance < 0 || distance > 2) {\n throw new Error(\n `paradeDbFuzzy: distance must be an integer in [0, 2]; got ${String(distance)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbFuzzy',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(distance)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.fuzzy({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/sorting/boost\n paradeDbBoost: {\n self: { codecId: TEXT },\n impl: (self, weight) => {\n if (!Number.isInteger(weight) || weight < -2048 || weight > 2048) {\n throw new Error(\n `paradeDbBoost: boost must be an integer in [-2048, 2048]; got ${String(weight)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbBoost',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(weight)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.boost({{arg0}})',\n },\n });\n },\n },\n paradeDbConst: {\n self: { codecId: TEXT },\n impl: (self, value) => {\n if (!Number.isInteger(value)) {\n throw new Error(`paradeDbConst: value must be an integer; got ${String(value)}`);\n }\n return buildOperation({\n method: 'paradeDbConst',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(value)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.const({{arg0}})',\n },\n });\n },\n },\n paradeDbSlop: {\n self: { codecId: TEXT },\n impl: (self, slop) => {\n if (!Number.isInteger(slop) || slop < 0) {\n throw new Error(`paradeDbSlop: slop must be a non-negative integer; got ${String(slop)}`);\n }\n return buildOperation({\n method: 'paradeDbSlop',\n args: [toExpr(self, TEXT_REF), LiteralExpr.of(slop)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.slop({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/full-text/proximity\n paradeDbProximity: {\n self: { codecId: TEXT },\n impl: (start) => new ParadeDbProximityChain(start),\n },\n };\n}\n\nexport const paradedbPackMeta = {\n kind: 'extension',\n id: PARADEDB_EXTENSION_ID,\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'paradedb/bm25': true,\n },\n },\n indexTypes: paradedbIndexTypes,\n types: {\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-paradedb/operation-types',\n named: 'QueryOperationTypes',\n alias: 'ParadeDbQueryOperationTypes',\n },\n },\n },\n} as const;\n"],"mappings":";;;;;;;AAGA,MAAa,wBAAwB;;;;;;;;;;;;;;;;AAiBrC,MAAa,oBAAoB;;;ACbjC,MAAMA,SAAO;AACb,MAAMC,aAAW,EAAE,SAASD,OAAK;AAejC,IAAa,yBAAb,MAAa,uBAEb;CACE,aAAsB;EAAE,SAASA;EAAM,UAAU;CAAM;CAEvD;CACA;CAEA,YAAY,OAAsB,QAAkC,CAAC,GAAG;EACtE,KAAK,QAAQ;EACb,KAAK,QAAQ;CACf;CAEA,OACE,UACA,MACA,SACwB;EACxB,IAAI,CAAC,OAAO,UAAU,QAAQ,KAAK,WAAW,GAC5C,MAAM,IAAI,MACR,0EAA0E,OAAO,QAAQ,GAC3F;EAEF,OAAO,IAAI,uBAAuB,KAAK,OAAO,CAC5C,GAAG,KAAK,O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I,KAAK,OAAO,GACpC,MAAM,IAAI,MAAM,0DAA0D,OAAO,IAAI,GAAG;IAE1F,OAAO,eAAe;KACpB,QAAQ;KACR,MAAM,CAAC,OAAO,MAAM,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;KACnD,SAAS;MAAE,SAAS;MAAM,UAAU;KAAM;KAC1C,UAAU;MACR,cAAc;MACd,UAAU;MACV,UAAU;KACZ;IACF,CAAC;GACH;EACF;EAEA,mBAAmB;GACjB,MAAM,EAAE,SAAS,KAAK;GACtB,OAAO,UAAU,IAAI,uBAAuB,KAAK;EACnD;CACF;AACF;AAEA,MAAa,mBAAmB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EACZ,UAAU,EACR,iBAAiB,KACnB,EACF;CACA,YAAY;CACZ,OAAO,EACL,qBAAqB,EACnB,QAAQ;EACN,SAAS;EACT,OAAO;EACP,OAAO;CACT,EACF,EACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-types-BZqoAhWT.mjs","names":[],"sources":["../src/types/index-types.ts"],"sourcesContent":["import { defineIndexTypes } from '@prisma-next/sql-contract/index-types';\nimport { type } from 'arktype';\n\nexport const paradedbIndexTypes = defineIndexTypes().add('bm25', {\n options: type({\n '+': 'reject',\n key_field: 'string',\n }),\n});\n\nexport type IndexTypes = typeof paradedbIndexTypes.IndexTypes;\nexport type Bm25IndexOptions = IndexTypes['bm25']['options'];\n"],"mappings":";;;AAGA,MAAa,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index-types-BZqoAhWT.mjs","names":[],"sources":["../src/types/index-types.ts"],"sourcesContent":["import { defineIndexTypes } from '@prisma-next/sql-contract/index-types';\nimport { type } from 'arktype';\n\nexport const paradedbIndexTypes = defineIndexTypes().add('bm25', {\n options: type({\n '+': 'reject',\n key_field: 'string',\n }),\n});\n\nexport type IndexTypes = typeof paradedbIndexTypes.IndexTypes;\nexport type Bm25IndexOptions = IndexTypes['bm25']['options'];\n"],"mappings":";;;AAGA,MAAa,qBAAqB,iBAAiB,EAAE,IAAI,QAAQ,EAC/D,SAAS,KAAK;CACZ,KAAK;CACL,WAAW;AACb,CAAC,EACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-types.d.mts","names":[],"sources":["../src/types/index-types.ts"],"mappings":";;;cAGa,kBAAA,EAAkB,wCAAA,CAAA,gBAAA,CAAA,MAAA,iBAAA,MAAA;EAAA;;;;KAOnB,UAAA,UAAoB,kBAAA,CAAmB,
|
|
1
|
+
{"version":3,"file":"index-types.d.mts","names":[],"sources":["../src/types/index-types.ts"],"mappings":";;;cAGa,kBAAA,EAAkB,wCAAA,CAAA,gBAAA,CAAA,MAAA,iBAAA,MAAA;EAAA;;;;KAOnB,UAAA,UAAoB,kBAAA,CAAmB,UAAU;AAAA,KACjD,gBAAA,GAAmB,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-types-DXmTJ7jd.d.mts","names":[],"sources":["../src/core/proximity-chain.ts","../src/types/operation-types.ts"],"mappings":";;;;;KAUY,aAAA;AAAA,UAEK,sBAAA;EAAA,SACN,
|
|
1
|
+
{"version":3,"file":"operation-types-DXmTJ7jd.d.mts","names":[],"sources":["../src/core/proximity-chain.ts","../src/types/operation-types.ts"],"mappings":";;;;;KAUY,aAAA;AAAA,UAEK,sBAAA;EAAA,SACN,OAAO;AAAA;AAAA,UAGR,aAAA;EAAA,SACC,QAAA;EAAA,SACA,IAAA,EAAM,aAAa;EAAA,SACnB,OAAA;AAAA;AAAA,cAIE,sBAAA,YACA,UAAA;EAAa,OAAA;EAAsB,QAAA;AAAA;EAAA,SAErC,UAAA;IAAA;;;mBAEQ,KAAA;EAAA,iBACA,KAAA;cAEL,KAAA,EAAO,aAAA,EAAe,KAAA,YAAgB,aAAA;EAKlD,MAAA,CACE,QAAA,UACA,IAAA,EAAM,aAAA,EACN,OAAA,GAAU,sBA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C,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,MACzC,UAAA;MAAa,OAAA;MAAwB,QAAA;IAAA;EAAA;EAAA,SAEnC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,QAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,MAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,KAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,YAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,IAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,iBAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GAAO,KAAA,EAAO,eAAA,uBAAsC,EAAA,MAAQ,sBAAA;EAAA;AAAA"}
|
package/dist/runtime.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/exports/runtime.ts"],"mappings":";;;cAGM,yBAAA,EAA2B,
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/exports/runtime.ts"],"mappings":";;;cAGM,yBAAA,EAA2B,6BAA6B"}
|
package/dist/runtime.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["import type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst paradedbRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: paradedbPackMeta.id,\n version: paradedbPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: () => [],\n queryOperations: () => paradedbQueryOperations(),\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default paradedbRuntimeDescriptor;\n"],"mappings":";;AAGA,MAAM,4BAAuE;CAC3E,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,UAAU;CACV,UAAU;CACV,cAAc,
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["import type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst paradedbRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: paradedbPackMeta.id,\n version: paradedbPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: () => [],\n queryOperations: () => paradedbQueryOperations(),\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default paradedbRuntimeDescriptor;\n"],"mappings":";;AAGA,MAAM,4BAAuE;CAC3E,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,UAAU;CACV,UAAU;CACV,cAAc,CAAC;CACf,uBAAuB,wBAAwB;CAC/C,SAAS;EACP,OAAO;GACL,UAAU;GACV,UAAU;EACZ;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/extension-paradedb",
|
|
3
|
-
"version": "0.11.0-dev.
|
|
3
|
+
"version": "0.11.0-dev.61",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@prisma-next/contract": "0.11.0-dev.
|
|
9
|
-
"@prisma-next/contract-authoring": "0.11.0-dev.
|
|
10
|
-
"@prisma-next/family-sql": "0.11.0-dev.
|
|
11
|
-
"@prisma-next/framework-components": "0.11.0-dev.
|
|
12
|
-
"@prisma-next/migration-tools": "0.11.0-dev.
|
|
13
|
-
"@prisma-next/sql-contract": "0.11.0-dev.
|
|
14
|
-
"@prisma-next/sql-operations": "0.11.0-dev.
|
|
15
|
-
"@prisma-next/sql-relational-core": "0.11.0-dev.
|
|
16
|
-
"@prisma-next/sql-runtime": "0.11.0-dev.
|
|
8
|
+
"@prisma-next/contract": "0.11.0-dev.61",
|
|
9
|
+
"@prisma-next/contract-authoring": "0.11.0-dev.61",
|
|
10
|
+
"@prisma-next/family-sql": "0.11.0-dev.61",
|
|
11
|
+
"@prisma-next/framework-components": "0.11.0-dev.61",
|
|
12
|
+
"@prisma-next/migration-tools": "0.11.0-dev.61",
|
|
13
|
+
"@prisma-next/sql-contract": "0.11.0-dev.61",
|
|
14
|
+
"@prisma-next/sql-operations": "0.11.0-dev.61",
|
|
15
|
+
"@prisma-next/sql-relational-core": "0.11.0-dev.61",
|
|
16
|
+
"@prisma-next/sql-runtime": "0.11.0-dev.61",
|
|
17
17
|
"arktype": "^2.2.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@prisma-next/adapter-postgres": "0.11.0-dev.
|
|
21
|
-
"@prisma-next/cli": "0.11.0-dev.
|
|
22
|
-
"@prisma-next/operations": "0.11.0-dev.
|
|
23
|
-
"@prisma-next/sql-contract-ts": "0.11.0-dev.
|
|
24
|
-
"@prisma-next/target-postgres": "0.11.0-dev.
|
|
25
|
-
"@prisma-next/test-utils": "0.11.0-dev.
|
|
26
|
-
"@prisma-next/tsconfig": "0.11.0-dev.
|
|
27
|
-
"@prisma-next/tsdown": "0.11.0-dev.
|
|
20
|
+
"@prisma-next/adapter-postgres": "0.11.0-dev.61",
|
|
21
|
+
"@prisma-next/cli": "0.11.0-dev.61",
|
|
22
|
+
"@prisma-next/operations": "0.11.0-dev.61",
|
|
23
|
+
"@prisma-next/sql-contract-ts": "0.11.0-dev.61",
|
|
24
|
+
"@prisma-next/target-postgres": "0.11.0-dev.61",
|
|
25
|
+
"@prisma-next/test-utils": "0.11.0-dev.61",
|
|
26
|
+
"@prisma-next/tsconfig": "0.11.0-dev.61",
|
|
27
|
+
"@prisma-next/tsdown": "0.11.0-dev.61",
|
|
28
28
|
"tsdown": "0.22.0",
|
|
29
29
|
"typescript": "5.9.3",
|
|
30
30
|
"vitest": "4.1.6"
|
package/src/contract.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
// ⚠️ GENERATED FILE - DO NOT EDIT
|
|
2
2
|
// This file is automatically generated by 'prisma-next contract emit'.
|
|
3
3
|
// To regenerate, run: prisma-next contract emit
|
|
4
|
-
import type { CodecTypes as PgTypes } from '@prisma-next/target-postgres/codec-types';
|
|
5
|
-
import type { JsonValue } from '@prisma-next/target-postgres/codec-types';
|
|
6
|
-
import type { Char } from '@prisma-next/target-postgres/codec-types';
|
|
7
|
-
import type { Varchar } from '@prisma-next/target-postgres/codec-types';
|
|
8
|
-
import type { Numeric } from '@prisma-next/target-postgres/codec-types';
|
|
9
|
-
import type { Bit } from '@prisma-next/target-postgres/codec-types';
|
|
10
|
-
import type { VarBit } from '@prisma-next/target-postgres/codec-types';
|
|
11
|
-
import type { Timestamp } from '@prisma-next/target-postgres/codec-types';
|
|
12
|
-
import type { Timestamptz } from '@prisma-next/target-postgres/codec-types';
|
|
13
|
-
import type { Time } from '@prisma-next/target-postgres/codec-types';
|
|
14
|
-
import type { Timetz } from '@prisma-next/target-postgres/codec-types';
|
|
15
|
-
import type { Interval } from '@prisma-next/target-postgres/codec-types';
|
|
16
4
|
import type { QueryOperationTypes as PgAdapterQueryOps } from '@prisma-next/adapter-postgres/operation-types';
|
|
5
|
+
import type {
|
|
6
|
+
Bit,
|
|
7
|
+
Char,
|
|
8
|
+
CodecTypes as PgTypes,
|
|
9
|
+
Interval,
|
|
10
|
+
JsonValue,
|
|
11
|
+
Numeric,
|
|
12
|
+
Time,
|
|
13
|
+
Timestamp,
|
|
14
|
+
Timestamptz,
|
|
15
|
+
Timetz,
|
|
16
|
+
VarBit,
|
|
17
|
+
Varchar,
|
|
18
|
+
} from '@prisma-next/target-postgres/codec-types';
|
|
17
19
|
|
|
18
20
|
import type {
|
|
19
21
|
ContractWithTypeMaps,
|
|
@@ -22,6 +24,7 @@ import type {
|
|
|
22
24
|
import type {
|
|
23
25
|
Contract as ContractType,
|
|
24
26
|
ExecutionHashBase,
|
|
27
|
+
NamespaceId,
|
|
25
28
|
ProfileHashBase,
|
|
26
29
|
StorageHashBase,
|
|
27
30
|
} from '@prisma-next/contract/types';
|
|
@@ -48,24 +51,28 @@ export type TypeMaps = TypeMapsType<
|
|
|
48
51
|
FieldInputTypes
|
|
49
52
|
>;
|
|
50
53
|
|
|
51
|
-
type ContractBase =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
readonly
|
|
55
|
-
readonly
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
type ContractBase = Omit<
|
|
55
|
+
ContractType<
|
|
56
|
+
{
|
|
57
|
+
readonly namespaces: {
|
|
58
|
+
readonly __unbound__: {
|
|
59
|
+
readonly id: '__unbound__';
|
|
60
|
+
readonly kind: 'sql-namespace';
|
|
61
|
+
readonly tables: {};
|
|
62
|
+
};
|
|
58
63
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
readonly storageHash: StorageHash;
|
|
65
|
+
},
|
|
66
|
+
Record<string, never>
|
|
67
|
+
>,
|
|
68
|
+
'roots'
|
|
63
69
|
> & {
|
|
64
70
|
readonly target: 'postgres';
|
|
65
71
|
readonly targetFamily: 'sql';
|
|
66
|
-
readonly roots: Record<string,
|
|
72
|
+
readonly roots: Record<string, never>;
|
|
67
73
|
readonly capabilities: {
|
|
68
74
|
readonly postgres: {
|
|
75
|
+
readonly distinctOn: true;
|
|
69
76
|
readonly jsonAgg: true;
|
|
70
77
|
readonly lateral: true;
|
|
71
78
|
readonly limit: true;
|
|
@@ -75,6 +82,7 @@ type ContractBase = ContractType<
|
|
|
75
82
|
readonly sql: {
|
|
76
83
|
readonly defaultInInsert: true;
|
|
77
84
|
readonly enums: true;
|
|
85
|
+
readonly lateral: true;
|
|
78
86
|
readonly returning: true;
|
|
79
87
|
};
|
|
80
88
|
};
|
package/src/contract.json
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"capabilities": {
|
|
19
19
|
"postgres": {
|
|
20
|
+
"distinctOn": true,
|
|
20
21
|
"jsonAgg": true,
|
|
21
22
|
"lateral": true,
|
|
22
23
|
"limit": true,
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"sql": {
|
|
27
28
|
"defaultInInsert": true,
|
|
28
29
|
"enums": true,
|
|
30
|
+
"lateral": true,
|
|
29
31
|
"returning": true
|
|
30
32
|
}
|
|
31
33
|
},
|