@prisma-next/extension-pgvector 0.12.0 → 0.13.0-dev.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/README.md +2 -9
- package/dist/{codec-types-D9jU-l1B.d.mts → codec-types-BAjDDnH_.d.mts} +1 -1
- package/dist/{codec-types-D9jU-l1B.d.mts.map → codec-types-BAjDDnH_.d.mts.map} +1 -1
- package/dist/codec-types.d.mts +2 -2
- package/dist/column-types.d.mts.map +1 -1
- package/dist/column-types.mjs +1 -1
- package/dist/{constants-DX-00vYk.mjs → constants-D8Ccy-f4.mjs} +1 -1
- package/dist/{constants-DX-00vYk.mjs.map → constants-D8Ccy-f4.mjs.map} +1 -1
- package/dist/control.mjs +18 -12
- package/dist/control.mjs.map +1 -1
- package/dist/{descriptor-meta-8UnGdpZ6.mjs → descriptor-meta-Bv7s7XWG.mjs} +2 -2
- package/dist/{descriptor-meta-8UnGdpZ6.mjs.map → descriptor-meta-Bv7s7XWG.mjs.map} +1 -1
- package/dist/{operation-types-Bd-jkNN3.d.mts → operation-types-CRvIvUpJ.d.mts} +1 -1
- package/dist/{operation-types-Bd-jkNN3.d.mts.map → operation-types-CRvIvUpJ.d.mts.map} +1 -1
- package/dist/operation-types.d.mts +2 -2
- package/dist/pack.d.mts +2 -4
- package/dist/pack.d.mts.map +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/runtime.mjs +1 -1
- package/package.json +23 -23
- package/src/contract.d.ts +11 -5
- package/src/contract.json +13 -5
package/README.md
CHANGED
|
@@ -200,16 +200,9 @@ The extension declares the following capabilities:
|
|
|
200
200
|
|
|
201
201
|
## Authoring (maintainers)
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
After changing the contract source, run `pnpm migrations:regen` from the repo root to keep migration metadata, `refs/head.json`, and `end-contract.*` consistent with the freshly-built `src/contract.json`; it is also wired into `pnpm fixtures:emit` automatically.
|
|
204
204
|
|
|
205
|
-
|
|
206
|
-
- `pnpm exec prisma-next migration plan --name <slug>` (run from this package directory) — scaffolds a new migration directory under `migrations/<dirName>/` for schema changes that touch tables / models. **Not chained into `pnpm build`**: `migration plan` is non-idempotent (each invocation generates a new timestamped directory), so it runs manually when the contract source changes. Note: pgvector's contract declares only the parameterised `vector` native type under `storage.types` (no tables / models), so the planner currently refuses to scaffold the baseline migration with `PN-CLI-4020 Contract changed but planner produced no operations` (this is **Path B** authoring per [ADR 212](../../../docs/architecture%20docs/adrs/ADR%20212%20-%20Contract%20spaces.md#contract-space-package-layout)). That directory was hand-authored once (Migration subclass + seed `migration.json` preserving the full `toContract`) and `pnpm tsx migrations/<dirName>/migration.ts` re-emits `ops.json` + `migration.json` deterministically. Future migrations that add tables / models can use `migration plan` directly (Path A).
|
|
207
|
-
- `pnpm tsx migrations/<dirName>/migration.ts` (run from this package directory) — re-emits `ops.json` + `migration.json` from the hand-edited subclass. Use `tsx`, not bare `node`, because the Migration subclass imports relative TypeScript siblings which Node's native loader can't resolve without a TS-aware loader.
|
|
208
|
-
- `migrations/refs/head.json` is hand-pinned with the latest migration's `to` hash + `providedInvariants`.
|
|
209
|
-
|
|
210
|
-
The descriptor at `src/exports/control.ts` then JSON-imports those artefacts and synthesises the framework's `MigrationPackage` shape.
|
|
211
|
-
|
|
212
|
-
See [ADR 212 — Contract spaces](../../../docs/architecture%20docs/adrs/ADR%20212%20-%20Contract%20spaces.md) ("Contract-space package layout") for the canonical layout and rationale.
|
|
205
|
+
See [ADR 212 — Contract spaces](../../../docs/architecture%20docs/adrs/ADR%20212%20-%20Contract%20spaces.md) ("Contract-space package layout") for the layout and rationale.
|
|
213
206
|
|
|
214
207
|
## References
|
|
215
208
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types-
|
|
1
|
+
{"version":3,"file":"codec-types-BAjDDnH_.d.mts","names":[],"sources":["../src/core/constants.ts","../src/core/codecs.ts","../src/types/codec-types.ts"],"mappings":";;;;;;;;;cAGa,eAAA;;;KCyBR,YAAA;EAAA,SAA0B,MAAM;AAAA;AAAA,cAiBxB,aAAA,SAAsB,SAAA,QAC1B,eAAA;EAAA,SAKE,MAAA;cAEG,UAAA,EAAY,kBAAA,EAAoB,MAAA;EAK5C,YAAA,CAAa,KAAA,oBAAyB,KAAA;EAYhC,MAAA,CAAO,KAAA,YAAiB,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAKjD,MAAA,CAAO,IAAA,UAAc,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAsBpD,UAAA,CAAW,KAAA,aAAkB,SAAA;EAK7B,UAAA,CAAW,IAAA,EAAM,SAAA;AAAA;AAAA,cAMN,kBAAA,SAA2B,mBAAA,CAAoB,YAAA;EAAA,SACxC,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,IAAA;IAAA;;;;;;;;WACA,YAAA,EAAc,gBAAA,CAAiB,YAAA;EACxC,gBAAA,CAAiB,MAAA,EAAQ,YAAA;EAGzB,OAAA,CAAQ,MAAA,EAAQ,YAAA,IAAgB,GAAA,EAAK,oBAAA,KAAyB,aAAA;AAAA;AAAA,cAkBnE,kBAAA;EAAA,iBAEI,kBAAA;AAAA;AAAA,KAEE,YAAA,GAAa,iBAAiB,QAAQ,kBAAA;;;;ADxIG;;;;ACuBS;KCTlD,MAAA;EAAA,SAA0D,cAAA,GAAiB,CAAC;AAAA;AAAA,KAE5E,UAAA,GAAa,YAAc"}
|
package/dist/codec-types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Vector, t as CodecTypes } from "./codec-types-
|
|
2
|
-
export {
|
|
1
|
+
import { n as Vector, t as CodecTypes } from "./codec-types-BAjDDnH_.mjs";
|
|
2
|
+
export type { CodecTypes, Vector };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-types.d.mts","names":[],"sources":["../src/exports/column-types.ts"],"mappings":";;;;;;;;;;;;;;;iBAmBgB,MAAA,
|
|
1
|
+
{"version":3,"file":"column-types.d.mts","names":[],"sources":["../src/exports/column-types.ts"],"mappings":";;;;;;;;;;;;;;;iBAmBgB,MAAA,mBACd,MAAA,EAAQ,CAAA,GACP,oBAAA;EAAA,SAAkC,UAAA;IAAA,SAAuB,MAAA,EAAQ,CAAA;EAAA;AAAA"}
|
package/dist/column-types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as VECTOR_MAX_DIM, t as VECTOR_CODEC_ID } from "./constants-
|
|
1
|
+
import { n as VECTOR_MAX_DIM, t as VECTOR_CODEC_ID } from "./constants-D8Ccy-f4.mjs";
|
|
2
2
|
//#region src/exports/column-types.ts
|
|
3
3
|
/**
|
|
4
4
|
* Factory for creating dimensioned vector column descriptors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-
|
|
1
|
+
{"version":3,"file":"constants-D8Ccy-f4.mjs","names":[],"sources":["../src/core/constants.ts"],"sourcesContent":["/**\n * Codec ID for pgvector's vector type.\n */\nexport const VECTOR_CODEC_ID = 'pg/vector@1' as const;\n\n/**\n * Maximum dimension for pgvector vectors (VECTOR_MAX_DIM from pgvector).\n */\nexport const VECTOR_MAX_DIM = 16000;\n"],"mappings":";;;;AAGA,MAAa,kBAAkB;;;;AAK/B,MAAa,iBAAiB"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as pgvectorQueryOperations, t as pgvectorPackMeta } from "./descriptor-meta-
|
|
1
|
+
import { n as pgvectorQueryOperations, t as pgvectorPackMeta } from "./descriptor-meta-Bv7s7XWG.mjs";
|
|
2
2
|
import { contractSpaceFromJson } from "@prisma-next/migration-tools/spaces";
|
|
3
3
|
//#region migrations/20260601T0000_install_vector_extension/migration.json
|
|
4
4
|
var migration_default = {
|
|
5
5
|
from: null,
|
|
6
|
-
to: "sha256:
|
|
6
|
+
to: "sha256:8ac1bfb344d599a74f9b5f6870cdddb912706594dc90228038ef218fd9a45965",
|
|
7
7
|
providedInvariants: ["pgvector:install-vector-v1"],
|
|
8
8
|
createdAt: "2026-06-01T00:00:00.000Z",
|
|
9
|
-
migrationHash: "sha256:
|
|
9
|
+
migrationHash: "sha256:50c33e8346c5e1f5c494dfef48b402675aaf5daa22264d380ddb11a7146671cf"
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region migrations/20260601T0000_install_vector_extension/ops.json
|
|
@@ -39,7 +39,7 @@ var ops_default = [{
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region migrations/refs/head.json
|
|
41
41
|
var head_default = {
|
|
42
|
-
hash: "sha256:
|
|
42
|
+
hash: "sha256:8ac1bfb344d599a74f9b5f6870cdddb912706594dc90228038ef218fd9a45965",
|
|
43
43
|
invariants: ["pgvector:install-vector-v1"]
|
|
44
44
|
};
|
|
45
45
|
//#endregion
|
|
@@ -52,17 +52,23 @@ var contract_default = {
|
|
|
52
52
|
roots: {},
|
|
53
53
|
domain: { "namespaces": { "public": { "models": {} } } },
|
|
54
54
|
storage: {
|
|
55
|
-
"namespaces": {
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
"namespaces": {
|
|
56
|
+
"__unbound__": {
|
|
57
|
+
"entries": { "table": {} },
|
|
58
|
+
"id": "__unbound__",
|
|
59
|
+
"kind": "postgres-unbound-schema"
|
|
60
|
+
},
|
|
61
|
+
"public": {
|
|
62
|
+
"entries": { "table": {} },
|
|
63
|
+
"id": "public",
|
|
64
|
+
"kind": "postgres-schema"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"storageHash": "sha256:8ac1bfb344d599a74f9b5f6870cdddb912706594dc90228038ef218fd9a45965",
|
|
61
68
|
"types": { "vector": {
|
|
62
69
|
"codecId": "pg/vector@1",
|
|
63
70
|
"kind": "codec-instance",
|
|
64
|
-
"nativeType": "vector"
|
|
65
|
-
"typeParams": {}
|
|
71
|
+
"nativeType": "vector"
|
|
66
72
|
} }
|
|
67
73
|
},
|
|
68
74
|
capabilities: {
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_vector_extension/migration.json","../migrations/20260601T0000_install_vector_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/core/contract-space-constants.ts","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Static names and identifiers used across pgvector'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 `'pgvector'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for pgvector-owned rows.\n *\n * The `pgvector:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\n\nexport const PGVECTOR_SPACE_ID = 'pgvector' as const;\n\nexport const PGVECTOR_NATIVE_TYPE = 'vector' as const;\n\nexport const PGVECTOR_BASELINE_MIGRATION_NAME = '20260601T0000_install_vector_extension' as const;\n\n/**\n * `pgvector:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers (other extensions,\n * the marker table) reference them by literal string match.\n */\nexport const PGVECTOR_INVARIANTS = {\n installVector: 'pgvector:install-vector-v1',\n} as const;\n","/**\n * Control-plane descriptor for the pgvector 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 * - `types.codecTypes.controlPlaneHooks[PGVECTOR_CODEC_ID]` — codec\n * control hooks (`expandNativeType`, `resolveIdentityValue`) the\n * SQL planner extracts via `extractCodecControlHooks` and uses to\n * render `vector(N)` column types and the canonical zero-vector\n * identity literal.\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 {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} 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_vector_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_vector_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 { PGVECTOR_SPACE_ID } from '../core/contract-space-constants';\nimport { pgvectorPackMeta, pgvectorQueryOperations } from '../core/descriptor-meta';\n\nconst PGVECTOR_CODEC_ID = 'pg/vector@1' as const;\nconst BASELINE_DIR_NAME = '20260601T0000_install_vector_extension';\n\nfunction buildVectorIdentityValue(typeParams: Record<string, unknown> | undefined): string | null {\n const length = typeParams?.['length'];\n if (typeof length !== 'number' || !Number.isInteger(length) || length <= 0) {\n return null;\n }\n\n const zeroVector = `[${new Array(length).fill('0').join(',')}]`;\n return `'${zeroVector}'::vector`;\n}\n\nconst vectorControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType, typeParams }) => {\n const length = typeParams?.['length'];\n if (typeof length === 'number' && Number.isInteger(length) && length > 0) {\n return `${nativeType}(${length})`;\n }\n return nativeType;\n },\n resolveIdentityValue: ({ typeParams }) => buildVectorIdentityValue(typeParams),\n};\n\nconst pgvectorContractSpace = 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 pgvectorExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...pgvectorPackMeta,\n id: PGVECTOR_SPACE_ID,\n contractSpace: pgvectorContractSpace,\n types: {\n ...pgvectorPackMeta.types,\n codecTypes: {\n ...pgvectorPackMeta.types.codecTypes,\n controlPlaneHooks: {\n [PGVECTOR_CODEC_ID]: vectorControlPlaneHooks,\n },\n },\n },\n queryOperations: () => pgvectorQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { pgvectorExtensionDescriptor };\nexport default pgvectorExtensionDescriptor;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_vector_extension/migration.json","../migrations/20260601T0000_install_vector_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/core/contract-space-constants.ts","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Static names and identifiers used across pgvector'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 `'pgvector'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for pgvector-owned rows.\n *\n * The `pgvector:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\n\nexport const PGVECTOR_SPACE_ID = 'pgvector' as const;\n\nexport const PGVECTOR_NATIVE_TYPE = 'vector' as const;\n\nexport const PGVECTOR_BASELINE_MIGRATION_NAME = '20260601T0000_install_vector_extension' as const;\n\n/**\n * `pgvector:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers (other extensions,\n * the marker table) reference them by literal string match.\n */\nexport const PGVECTOR_INVARIANTS = {\n installVector: 'pgvector:install-vector-v1',\n} as const;\n","/**\n * Control-plane descriptor for the pgvector 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 * - `types.codecTypes.controlPlaneHooks[PGVECTOR_CODEC_ID]` — codec\n * control hooks (`expandNativeType`, `resolveIdentityValue`) the\n * SQL planner extracts via `extractCodecControlHooks` and uses to\n * render `vector(N)` column types and the canonical zero-vector\n * identity literal.\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 {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} 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_vector_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_vector_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 { PGVECTOR_SPACE_ID } from '../core/contract-space-constants';\nimport { pgvectorPackMeta, pgvectorQueryOperations } from '../core/descriptor-meta';\n\nconst PGVECTOR_CODEC_ID = 'pg/vector@1' as const;\nconst BASELINE_DIR_NAME = '20260601T0000_install_vector_extension';\n\nfunction buildVectorIdentityValue(typeParams: Record<string, unknown> | undefined): string | null {\n const length = typeParams?.['length'];\n if (typeof length !== 'number' || !Number.isInteger(length) || length <= 0) {\n return null;\n }\n\n const zeroVector = `[${new Array(length).fill('0').join(',')}]`;\n return `'${zeroVector}'::vector`;\n}\n\nconst vectorControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType, typeParams }) => {\n const length = typeParams?.['length'];\n if (typeof length === 'number' && Number.isInteger(length) && length > 0) {\n return `${nativeType}(${length})`;\n }\n return nativeType;\n },\n resolveIdentityValue: ({ typeParams }) => buildVectorIdentityValue(typeParams),\n};\n\nconst pgvectorContractSpace = 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 pgvectorExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...pgvectorPackMeta,\n id: PGVECTOR_SPACE_ID,\n contractSpace: pgvectorContractSpace,\n types: {\n ...pgvectorPackMeta.types,\n codecTypes: {\n ...pgvectorPackMeta.types.codecTypes,\n controlPlaneHooks: {\n [PGVECTOR_CODEC_ID]: vectorControlPlaneHooks,\n },\n },\n },\n queryOperations: () => pgvectorQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { pgvectorExtensionDescriptor };\nexport default pgvectorExtensionDescriptor;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIgBA,MAAa,oBAAoB;;;ACkCjC,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAE1B,SAAS,yBAAyB,YAAgE;CAChG,MAAM,SAAS,aAAa;CAC5B,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,UAAU,MAAM,KAAK,UAAU,GACvE,OAAO;CAIT,OAAO,IAAI,IADY,IAAI,MAAM,MAAM,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,GACvC;AACxB;AAEA,MAAM,0BAA6C;CACjD,mBAAmB,EAAE,YAAY,iBAAiB;EAChD,MAAM,SAAS,aAAa;EAC5B,IAAI,OAAO,WAAW,YAAY,OAAO,UAAU,MAAM,KAAK,SAAS,GACrE,OAAO,GAAG,WAAW,GAAG,OAAO;EAEjC,OAAO;CACT;CACA,uBAAuB,EAAE,iBAAiB,yBAAyB,UAAU;AAC/E;AAEA,MAAM,wBAAwB,sBAA4C;CACxE,cAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;EACV,KAAKC;CACP,CACF;CACA,SAAA;AACF,CAAC;AAED,MAAM,8BAAyE;CAC7E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,OAAO;EACL,GAAG,iBAAiB;EACpB,YAAY;GACV,GAAG,iBAAiB,MAAM;GAC1B,mBAAmB,GAChB,oBAAoB,wBACvB;EACF;CACF;CACA,uBAAuB,wBAAwB;CAC/C,eAAe;EACb,UAAU;EACV,UAAU;CACZ;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as VECTOR_MAX_DIM, t as VECTOR_CODEC_ID } from "./constants-
|
|
1
|
+
import { n as VECTOR_MAX_DIM, t as VECTOR_CODEC_ID } from "./constants-D8Ccy-f4.mjs";
|
|
2
2
|
import { buildOperation, codecOf, toExpr } from "@prisma-next/sql-relational-core/expression";
|
|
3
3
|
import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/codec-descriptor-registry";
|
|
4
4
|
import { CodecDescriptorImpl, CodecImpl } from "@prisma-next/framework-components/codec";
|
|
@@ -177,4 +177,4 @@ const pgvectorPackMeta = {
|
|
|
177
177
|
//#endregion
|
|
178
178
|
export { pgvectorQueryOperations as n, pgvectorCodecRegistry as r, pgvectorPackMeta as t };
|
|
179
179
|
|
|
180
|
-
//# sourceMappingURL=descriptor-meta-
|
|
180
|
+
//# sourceMappingURL=descriptor-meta-Bv7s7XWG.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-8UnGdpZ6.mjs","names":["arktype"],"sources":["../src/core/authoring.ts","../src/core/codecs.ts","../src/core/registry.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["import type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\nimport { VECTOR_MAX_DIM } from './constants';\n\nexport const pgvectorAuthoringTypes = {\n pgvector: {\n Vector: {\n kind: 'typeConstructor',\n args: [\n { kind: 'number', name: 'length', integer: true, minimum: 1, maximum: VECTOR_MAX_DIM },\n ],\n output: {\n codecId: 'pg/vector@1',\n nativeType: 'vector',\n typeParams: {\n length: { kind: 'arg', index: 0 },\n },\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n","/**\n * pgvector extension codec.\n *\n * Mirrors the patterns in `postgres/codecs-class.ts` and `sqlite/codecs-class.ts` for the single `pg/vector@1` codec. Three artifacts:\n *\n * 1. `PgVectorCodec` extends {@link CodecImpl} with the runtime encode/decode/encodeJson/decodeJson conversions inline. Conversions are simple enough (PostgreSQL `[1,2,3]` text format) that no shared helper module is warranted; the class body is the source of truth.\n * 2. `PgVectorDescriptor` extends {@link CodecDescriptorImpl} with the codec id, traits, target types, params schema (`{ length: number }`, validated against {@link VECTOR_MAX_DIM}), `meta` (postgres `nativeType: 'vector'`), and the emit-path `renderOutputType` producing `Vector<${length}>`.\n * 3. `pgVectorColumn(length)` per-codec column helper invoking `descriptor.factory({ length })` directly + passing the bare `nativeType: 'vector'`. The family-layer {@link expandNativeType} hook renders the parameterized form (`vector(1536)`) at emit/verify time from `nativeType` + `typeParams`.\n *\n * `length` threads into the runtime codec via the constructor so encode/decode/encodeJson/decodeJson enforce the declared dimension at every ingress path. Without this, `vector(3)` and `vector(1536)` would produce codecs with identical behaviour and a dimension-mismatched value would round-trip undetected.\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n} from '@prisma-next/framework-components/codec';\nimport type { ExtractCodecTypes } from '@prisma-next/sql-relational-core/ast';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { type as arktype } from 'arktype';\nimport { VECTOR_CODEC_ID, VECTOR_MAX_DIM } from './constants';\n\ntype VectorParams = { readonly length: number };\n\nconst vectorParamsSchema = arktype({\n length: 'number',\n}).narrow((params, ctx) => {\n const { length } = params;\n if (!Number.isInteger(length)) {\n return ctx.mustBe('an integer');\n }\n if (length < 1 || length > VECTOR_MAX_DIM) {\n return ctx.mustBe(`in the range [1, ${VECTOR_MAX_DIM}]`);\n }\n return true;\n}) satisfies StandardSchemaV1<VectorParams>;\n\nconst PG_VECTOR_META = { db: { sql: { postgres: { nativeType: 'vector' } } } } as const;\n\nexport class PgVectorCodec extends CodecImpl<\n typeof VECTOR_CODEC_ID,\n readonly ['equality'],\n string,\n number[]\n> {\n readonly length: number;\n\n constructor(descriptor: AnyCodecDescriptor, length: number) {\n super(descriptor);\n this.length = length;\n }\n\n assertVector(value: unknown): asserts value is number[] {\n if (!Array.isArray(value)) {\n throw new Error('Vector value must be an array of numbers');\n }\n if (!value.every((v) => typeof v === 'number')) {\n throw new Error('Vector value must contain only numbers');\n }\n if (value.length !== this.length) {\n throw new Error(`Vector length mismatch: expected ${this.length}, got ${value.length}`);\n }\n }\n\n async encode(value: number[], _ctx: CodecCallContext): Promise<string> {\n this.assertVector(value);\n return `[${value.join(',')}]`;\n }\n\n async decode(wire: string, _ctx: CodecCallContext): Promise<number[]> {\n if (typeof wire !== 'string') {\n throw new Error('Vector wire value must be a string');\n }\n if (!wire.startsWith('[') || !wire.endsWith(']')) {\n throw new Error(`Invalid vector format: expected \"[...]\", got \"${wire}\"`);\n }\n const content = wire.slice(1, -1).trim();\n const parsed =\n content === ''\n ? []\n : content.split(',').map((v) => {\n const num = Number.parseFloat(v.trim());\n if (Number.isNaN(num)) {\n throw new Error(`Invalid vector value: \"${v}\" is not a number`);\n }\n return num;\n });\n this.assertVector(parsed);\n return parsed;\n }\n\n encodeJson(value: number[]): JsonValue {\n this.assertVector(value);\n return value;\n }\n\n decodeJson(json: JsonValue): number[] {\n this.assertVector(json);\n return json;\n }\n}\n\nexport class PgVectorDescriptor extends CodecDescriptorImpl<VectorParams> {\n override readonly codecId = VECTOR_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['vector'] as const;\n override readonly meta = PG_VECTOR_META;\n override readonly paramsSchema: StandardSchemaV1<VectorParams> = vectorParamsSchema;\n override renderOutputType(params: VectorParams): string {\n return `Vector<${params.length}>`;\n }\n override factory(params: VectorParams): (ctx: CodecInstanceContext) => PgVectorCodec {\n return () => new PgVectorCodec(this, params.length);\n }\n}\n\nexport const pgVectorDescriptor = new PgVectorDescriptor();\n\n/**\n * Per-codec column helper for `pg/vector@1`. Generic over `N extends number` so the column site preserves the dimension literal in `typeParams` (e.g. `pgVectorColumn(1536)` packs `typeParams: { length: 1536 }`).\n *\n * Passes the bare `nativeType: 'vector'`; the family-layer `expandNativeType` hook renders the parameterized form (`vector(1536)`) at emit/verify time from `nativeType` + `typeParams`.\n */\nexport const pgVectorColumn = <N extends number>(length: N) =>\n column(pgVectorDescriptor.factory({ length }), pgVectorDescriptor.codecId, { length }, 'vector');\n\npgVectorColumn satisfies ColumnHelperFor<PgVectorDescriptor>;\npgVectorColumn satisfies ColumnHelperForStrict<PgVectorDescriptor>;\n\nconst codecDescriptorMap = {\n vector: pgVectorDescriptor,\n} as const;\n\nexport type CodecTypes = ExtractCodecTypes<typeof codecDescriptorMap>;\n\nexport const codecDescriptors: readonly AnyCodecDescriptor[] = Object.values(codecDescriptorMap);\n","import { buildCodecDescriptorRegistry } from '@prisma-next/sql-relational-core/codec-descriptor-registry';\nimport type { CodecDescriptorRegistry } from '@prisma-next/sql-relational-core/query-lane-context';\nimport { codecDescriptors } from './codecs';\n\n/**\n * Registry of every codec descriptor shipped by `@prisma-next/extension-pgvector`.\n *\n * Public consumer surface for the pgvector codec set. Currently a single entry (`pg/vector@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.\n */\nexport const pgvectorCodecRegistry: CodecDescriptorRegistry =\n buildCodecDescriptorRegistry(codecDescriptors);\n","import {\n buildOperation,\n type CodecExpression,\n codecOf,\n type Expression,\n toExpr,\n} from '@prisma-next/sql-relational-core/expression';\nimport type { CodecTypes } from '../types/codec-types';\nimport type { QueryOperationTypes } from '../types/operation-types';\nimport { pgvectorAuthoringTypes } from './authoring';\nimport { pgvectorCodecRegistry } from './registry';\n\nconst pgvectorTypeId = 'pg/vector@1' as const;\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\nexport function pgvectorQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n return {\n cosineDistance: {\n self: { codecId: pgvectorTypeId },\n impl: (\n self: CodecExpression<'pg/vector@1', boolean, CT>,\n other: CodecExpression<'pg/vector@1', boolean, CT>,\n ): Expression<{ codecId: 'pg/float8@1'; nullable: false }> => {\n const selfCodec = codecOf(self);\n return buildOperation({\n method: 'cosineDistance',\n args: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n returns: { codecId: 'pg/float8@1', nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} <=> {{arg0}}',\n },\n });\n },\n },\n cosineSimilarity: {\n self: { codecId: pgvectorTypeId },\n impl: (\n self: CodecExpression<'pg/vector@1', boolean, CT>,\n other: CodecExpression<'pg/vector@1', boolean, CT>,\n ): Expression<{ codecId: 'pg/float8@1'; nullable: false }> => {\n const selfCodec = codecOf(self);\n return buildOperation({\n method: 'cosineSimilarity',\n args: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n returns: { codecId: 'pg/float8@1', nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '1 - ({{self}} <=> {{arg0}})',\n },\n });\n },\n },\n };\n}\n\nconst pgvectorPackMetaBase = {\n kind: 'extension',\n id: 'pgvector',\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'pgvector.cosine': true,\n },\n },\n authoring: {\n type: pgvectorAuthoringTypes,\n },\n types: {\n codecTypes: {\n codecDescriptors: Array.from(pgvectorCodecRegistry.values()),\n import: {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'CodecTypes',\n alias: 'PgVectorTypes',\n },\n typeImports: [\n {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'Vector',\n alias: 'Vector',\n },\n ],\n },\n operationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'OperationTypes',\n alias: 'PgVectorOperationTypes',\n },\n },\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'QueryOperationTypes',\n alias: 'PgVectorQueryOperationTypes',\n },\n },\n storage: [\n { typeId: pgvectorTypeId, familyId: 'sql', targetId: 'postgres', nativeType: 'vector' },\n ],\n },\n} as const;\n\nexport const pgvectorPackMeta: typeof pgvectorPackMetaBase & {\n readonly __codecTypes?: CodecTypes;\n} = pgvectorPackMetaBase;\n"],"mappings":";;;;;;AAGA,MAAa,yBAAyB,EACpC,UAAU,EACR,QAAQ;CACN,MAAM;CACN,MAAM,CACJ;EAAE,MAAM;EAAU,MAAM;EAAU,SAAS;EAAM,SAAS;EAAG,SAAS;CAAe,CACvF;CACA,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAA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AAO,OAAO,SAAS,CAAC;KACxD,SAAS;MAAE,SAAS;MAAe,UAAU;KAAM;KACnD,UAAU;MACR,cAAc;MACd,UAAU;MACV,UAAU;KACZ;IACF,CAAC;GACH;EACF;CACF;AACF;AAoDA,MAAa,mBAET;CAnDF,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EACZ,UAAU,EACR,mBAAmB,KACrB,EACF;CACA,WAAW,EACT,MAAM,uBACR;CACA,OAAO;EACL,YAAY;GACV,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC;GAC3D,QAAQ;IACN,SAAS;IACT,OAAO;IACP,OAAO;GACT;GACA,aAAa,CACX;IACE,SAAS;IACT,OAAO;IACP,OAAO;GACT,CACF;EACF;EACA,gBAAgB,EACd,QAAQ;GACN,SAAS;GACT,OAAO;GACP,OAAO;EACT,EACF;EACA,qBAAqB,EACnB,QAAQ;GACN,SAAS;GACT,OAAO;GACP,OAAO;EACT,EACF;EACA,SAAS,CACP;GAAE,QAAQ;GAAgB,UAAU;GAAO,UAAU;GAAY,YAAY;EAAS,CACxF;CACF;AAKE"}
|
|
1
|
+
{"version":3,"file":"descriptor-meta-Bv7s7XWG.mjs","names":["arktype"],"sources":["../src/core/authoring.ts","../src/core/codecs.ts","../src/core/registry.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["import type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\nimport { VECTOR_MAX_DIM } from './constants';\n\nexport const pgvectorAuthoringTypes = {\n pgvector: {\n Vector: {\n kind: 'typeConstructor',\n args: [\n { kind: 'number', name: 'length', integer: true, minimum: 1, maximum: VECTOR_MAX_DIM },\n ],\n output: {\n codecId: 'pg/vector@1',\n nativeType: 'vector',\n typeParams: {\n length: { kind: 'arg', index: 0 },\n },\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n","/**\n * pgvector extension codec.\n *\n * Mirrors the patterns in `postgres/codecs-class.ts` and `sqlite/codecs-class.ts` for the single `pg/vector@1` codec. Three artifacts:\n *\n * 1. `PgVectorCodec` extends {@link CodecImpl} with the runtime encode/decode/encodeJson/decodeJson conversions inline. Conversions are simple enough (PostgreSQL `[1,2,3]` text format) that no shared helper module is warranted; the class body is the source of truth.\n * 2. `PgVectorDescriptor` extends {@link CodecDescriptorImpl} with the codec id, traits, target types, params schema (`{ length: number }`, validated against {@link VECTOR_MAX_DIM}), `meta` (postgres `nativeType: 'vector'`), and the emit-path `renderOutputType` producing `Vector<${length}>`.\n * 3. `pgVectorColumn(length)` per-codec column helper invoking `descriptor.factory({ length })` directly + passing the bare `nativeType: 'vector'`. The family-layer {@link expandNativeType} hook renders the parameterized form (`vector(1536)`) at emit/verify time from `nativeType` + `typeParams`.\n *\n * `length` threads into the runtime codec via the constructor so encode/decode/encodeJson/decodeJson enforce the declared dimension at every ingress path. Without this, `vector(3)` and `vector(1536)` would produce codecs with identical behaviour and a dimension-mismatched value would round-trip undetected.\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n} from '@prisma-next/framework-components/codec';\nimport type { ExtractCodecTypes } from '@prisma-next/sql-relational-core/ast';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { type as arktype } from 'arktype';\nimport { VECTOR_CODEC_ID, VECTOR_MAX_DIM } from './constants';\n\ntype VectorParams = { readonly length: number };\n\nconst vectorParamsSchema = arktype({\n length: 'number',\n}).narrow((params, ctx) => {\n const { length } = params;\n if (!Number.isInteger(length)) {\n return ctx.mustBe('an integer');\n }\n if (length < 1 || length > VECTOR_MAX_DIM) {\n return ctx.mustBe(`in the range [1, ${VECTOR_MAX_DIM}]`);\n }\n return true;\n}) satisfies StandardSchemaV1<VectorParams>;\n\nconst PG_VECTOR_META = { db: { sql: { postgres: { nativeType: 'vector' } } } } as const;\n\nexport class PgVectorCodec extends CodecImpl<\n typeof VECTOR_CODEC_ID,\n readonly ['equality'],\n string,\n number[]\n> {\n readonly length: number;\n\n constructor(descriptor: AnyCodecDescriptor, length: number) {\n super(descriptor);\n this.length = length;\n }\n\n assertVector(value: unknown): asserts value is number[] {\n if (!Array.isArray(value)) {\n throw new Error('Vector value must be an array of numbers');\n }\n if (!value.every((v) => typeof v === 'number')) {\n throw new Error('Vector value must contain only numbers');\n }\n if (value.length !== this.length) {\n throw new Error(`Vector length mismatch: expected ${this.length}, got ${value.length}`);\n }\n }\n\n async encode(value: number[], _ctx: CodecCallContext): Promise<string> {\n this.assertVector(value);\n return `[${value.join(',')}]`;\n }\n\n async decode(wire: string, _ctx: CodecCallContext): Promise<number[]> {\n if (typeof wire !== 'string') {\n throw new Error('Vector wire value must be a string');\n }\n if (!wire.startsWith('[') || !wire.endsWith(']')) {\n throw new Error(`Invalid vector format: expected \"[...]\", got \"${wire}\"`);\n }\n const content = wire.slice(1, -1).trim();\n const parsed =\n content === ''\n ? []\n : content.split(',').map((v) => {\n const num = Number.parseFloat(v.trim());\n if (Number.isNaN(num)) {\n throw new Error(`Invalid vector value: \"${v}\" is not a number`);\n }\n return num;\n });\n this.assertVector(parsed);\n return parsed;\n }\n\n encodeJson(value: number[]): JsonValue {\n this.assertVector(value);\n return value;\n }\n\n decodeJson(json: JsonValue): number[] {\n this.assertVector(json);\n return json;\n }\n}\n\nexport class PgVectorDescriptor extends CodecDescriptorImpl<VectorParams> {\n override readonly codecId = VECTOR_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['vector'] as const;\n override readonly meta = PG_VECTOR_META;\n override readonly paramsSchema: StandardSchemaV1<VectorParams> = vectorParamsSchema;\n override renderOutputType(params: VectorParams): string {\n return `Vector<${params.length}>`;\n }\n override factory(params: VectorParams): (ctx: CodecInstanceContext) => PgVectorCodec {\n return () => new PgVectorCodec(this, params.length);\n }\n}\n\nexport const pgVectorDescriptor = new PgVectorDescriptor();\n\n/**\n * Per-codec column helper for `pg/vector@1`. Generic over `N extends number` so the column site preserves the dimension literal in `typeParams` (e.g. `pgVectorColumn(1536)` packs `typeParams: { length: 1536 }`).\n *\n * Passes the bare `nativeType: 'vector'`; the family-layer `expandNativeType` hook renders the parameterized form (`vector(1536)`) at emit/verify time from `nativeType` + `typeParams`.\n */\nexport const pgVectorColumn = <N extends number>(length: N) =>\n column(pgVectorDescriptor.factory({ length }), pgVectorDescriptor.codecId, { length }, 'vector');\n\npgVectorColumn satisfies ColumnHelperFor<PgVectorDescriptor>;\npgVectorColumn satisfies ColumnHelperForStrict<PgVectorDescriptor>;\n\nconst codecDescriptorMap = {\n vector: pgVectorDescriptor,\n} as const;\n\nexport type CodecTypes = ExtractCodecTypes<typeof codecDescriptorMap>;\n\nexport const codecDescriptors: readonly AnyCodecDescriptor[] = Object.values(codecDescriptorMap);\n","import { buildCodecDescriptorRegistry } from '@prisma-next/sql-relational-core/codec-descriptor-registry';\nimport type { CodecDescriptorRegistry } from '@prisma-next/sql-relational-core/query-lane-context';\nimport { codecDescriptors } from './codecs';\n\n/**\n * Registry of every codec descriptor shipped by `@prisma-next/extension-pgvector`.\n *\n * Public consumer surface for the pgvector codec set. Currently a single entry (`pg/vector@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.\n */\nexport const pgvectorCodecRegistry: CodecDescriptorRegistry =\n buildCodecDescriptorRegistry(codecDescriptors);\n","import {\n buildOperation,\n type CodecExpression,\n codecOf,\n type Expression,\n toExpr,\n} from '@prisma-next/sql-relational-core/expression';\nimport type { CodecTypes } from '../types/codec-types';\nimport type { QueryOperationTypes } from '../types/operation-types';\nimport { pgvectorAuthoringTypes } from './authoring';\nimport { pgvectorCodecRegistry } from './registry';\n\nconst pgvectorTypeId = 'pg/vector@1' as const;\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\nexport function pgvectorQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n return {\n cosineDistance: {\n self: { codecId: pgvectorTypeId },\n impl: (\n self: CodecExpression<'pg/vector@1', boolean, CT>,\n other: CodecExpression<'pg/vector@1', boolean, CT>,\n ): Expression<{ codecId: 'pg/float8@1'; nullable: false }> => {\n const selfCodec = codecOf(self);\n return buildOperation({\n method: 'cosineDistance',\n args: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n returns: { codecId: 'pg/float8@1', nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} <=> {{arg0}}',\n },\n });\n },\n },\n cosineSimilarity: {\n self: { codecId: pgvectorTypeId },\n impl: (\n self: CodecExpression<'pg/vector@1', boolean, CT>,\n other: CodecExpression<'pg/vector@1', boolean, CT>,\n ): Expression<{ codecId: 'pg/float8@1'; nullable: false }> => {\n const selfCodec = codecOf(self);\n return buildOperation({\n method: 'cosineSimilarity',\n args: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n returns: { codecId: 'pg/float8@1', nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '1 - ({{self}} <=> {{arg0}})',\n },\n });\n },\n },\n };\n}\n\nconst pgvectorPackMetaBase = {\n kind: 'extension',\n id: 'pgvector',\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'pgvector.cosine': true,\n },\n },\n authoring: {\n type: pgvectorAuthoringTypes,\n },\n types: {\n codecTypes: {\n codecDescriptors: Array.from(pgvectorCodecRegistry.values()),\n import: {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'CodecTypes',\n alias: 'PgVectorTypes',\n },\n typeImports: [\n {\n package: '@prisma-next/extension-pgvector/codec-types',\n named: 'Vector',\n alias: 'Vector',\n },\n ],\n },\n operationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'OperationTypes',\n alias: 'PgVectorOperationTypes',\n },\n },\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-pgvector/operation-types',\n named: 'QueryOperationTypes',\n alias: 'PgVectorQueryOperationTypes',\n },\n },\n storage: [\n { typeId: pgvectorTypeId, familyId: 'sql', targetId: 'postgres', nativeType: 'vector' },\n ],\n },\n} as const;\n\nexport const pgvectorPackMeta: typeof pgvectorPackMetaBase & {\n readonly __codecTypes?: CodecTypes;\n} = pgvectorPackMetaBase;\n"],"mappings":";;;;;;AAGA,MAAa,yBAAyB,EACpC,UAAU,EACR,QAAQ;CACN,MAAM;CACN,MAAM,CACJ;EAAE,MAAM;EAAU,MAAM;EAAU,SAAS;EAAM,SAAS;EAAG,SAAS;CAAe,CACvF;CACA,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;EAAE,EAClC;CACF;AACF,EACF,EACF;;;ACWA,MAAM,qBAAqBA,KAAQ,EACjC,QAAQ,SACV,CAAC,CAAC,CAAC,QAAQ,QAAQ,QAAQ;CACzB,MAAM,EAAE,WAAW;CACnB,IAAI,CAAC,OAAO,UAAU,MAAM,GAC1B,OAAO,IAAI,OAAO,YAAY;CAEhC,IAAI,SAAS,KAAK,SAAA,MAChB,OAAO,IAAI,OAAO,oBAAoB,eAAe,EAAE;CAEzD,OAAO;AACT,CAAC;AAED,MAAM,iBAAiB,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,SAAS,EAAE,EAAE,EAAE;AAE7E,IAAa,gBAAb,cAAmC,UAKjC;CACA;CAEA,YAAY,YAAgC,QAAgB;EAC1D,MAAM,UAAU;EAChB,KAAK,SAAS;CAChB;CAEA,aAAa,OAA2C;EACtD,IAAI,CAAC,MAAM,QAAQ,KAAK,GACtB,MAAM,IAAI,MAAM,0CAA0C;EAE5D,IAAI,CAAC,MAAM,OAAO,MAAM,OAAO,MAAM,QAAQ,GAC3C,MAAM,IAAI,MAAM,wCAAwC;EAE1D,IAAI,MAAM,WAAW,KAAK,QACxB,MAAM,IAAI,MAAM,oCAAoC,KAAK,OAAO,QAAQ,M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
|
1
|
+
{"version":3,"file":"operation-types-CRvIvUpJ.d.mts","names":[],"sources":["../src/types/operation-types.ts"],"mappings":";;;;KAGK,cAAA,GAAiB,MAAM;EAAA,SAAoB,KAAA;EAAA,SAAyB,MAAA;AAAA;;;;;;;AAAM;AAAA,KAUnE,mBAAA,YAA+B,cAAA,IAAkB,sBAAA,CAC3D,EAAA;EAAA,SAEW,cAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,yBAAwC,EAAA,GAC9C,KAAA,EAAO,eAAA,yBAAwC,EAAA,MAC5C,UAAA;MAAa,OAAA;MAAwB,QAAA;IAAA;EAAA;EAAA,SAEnC,gBAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,yBAAwC,EAAA,GAC9C,KAAA,EAAO,eAAA,yBAAwC,EAAA,MAC5C,UAAA;MAAa,OAAA;MAAwB,QAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as QueryOperationTypes } from "./operation-types-
|
|
2
|
-
export {
|
|
1
|
+
import { t as QueryOperationTypes } from "./operation-types-CRvIvUpJ.mjs";
|
|
2
|
+
export type { QueryOperationTypes };
|
package/dist/pack.d.mts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { t as CodecTypes } from "./codec-types-
|
|
2
|
-
import * as _$_prisma_next_framework_components_codec0 from "@prisma-next/framework-components/codec";
|
|
3
|
-
|
|
1
|
+
import { t as CodecTypes } from "./codec-types-BAjDDnH_.mjs";
|
|
4
2
|
//#region src/core/descriptor-meta.d.ts
|
|
5
3
|
declare const pgvectorPackMetaBase: {
|
|
6
4
|
readonly kind: "extension";
|
|
@@ -41,7 +39,7 @@ declare const pgvectorPackMetaBase: {
|
|
|
41
39
|
};
|
|
42
40
|
readonly types: {
|
|
43
41
|
readonly codecTypes: {
|
|
44
|
-
readonly codecDescriptors:
|
|
42
|
+
readonly codecDescriptors: import("@prisma-next/framework-components/codec").CodecDescriptor<unknown>[];
|
|
45
43
|
readonly import: {
|
|
46
44
|
readonly package: "@prisma-next/extension-pgvector/codec-types";
|
|
47
45
|
readonly named: "CodecTypes";
|
package/dist/pack.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"mappings":";;cA2DM,oBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkDO,gBAAA,SAAyB,oBAAA;EAAA,SAC3B,YAAA,GAAe,UAAU;AAAA"}
|
package/dist/pack.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as pgvectorPackMeta } from "./descriptor-meta-
|
|
1
|
+
import { t as pgvectorPackMeta } from "./descriptor-meta-Bv7s7XWG.mjs";
|
|
2
2
|
export { pgvectorPackMeta as default };
|
package/dist/runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as pgvectorQueryOperations, r as pgvectorCodecRegistry, t as pgvectorPackMeta } from "./descriptor-meta-
|
|
1
|
+
import { n as pgvectorQueryOperations, r as pgvectorCodecRegistry, t as pgvectorPackMeta } from "./descriptor-meta-Bv7s7XWG.mjs";
|
|
2
2
|
//#region src/exports/runtime.ts
|
|
3
3
|
const pgvectorRuntimeDescriptor = {
|
|
4
4
|
kind: "extension",
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/extension-pgvector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-dev.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@prisma-next/contract": "0.
|
|
9
|
-
"@prisma-next/contract-authoring": "0.
|
|
10
|
-
"@prisma-next/family-sql": "0.
|
|
11
|
-
"@prisma-next/framework-components": "0.
|
|
12
|
-
"@prisma-next/migration-tools": "0.
|
|
13
|
-
"@prisma-next/sql-contract": "0.
|
|
14
|
-
"@prisma-next/sql-operations": "0.
|
|
15
|
-
"@prisma-next/sql-relational-core": "0.
|
|
16
|
-
"@prisma-next/sql-runtime": "0.
|
|
17
|
-
"@prisma-next/sql-schema-ir": "0.
|
|
8
|
+
"@prisma-next/contract": "0.13.0-dev.1",
|
|
9
|
+
"@prisma-next/contract-authoring": "0.13.0-dev.1",
|
|
10
|
+
"@prisma-next/family-sql": "0.13.0-dev.1",
|
|
11
|
+
"@prisma-next/framework-components": "0.13.0-dev.1",
|
|
12
|
+
"@prisma-next/migration-tools": "0.13.0-dev.1",
|
|
13
|
+
"@prisma-next/sql-contract": "0.13.0-dev.1",
|
|
14
|
+
"@prisma-next/sql-operations": "0.13.0-dev.1",
|
|
15
|
+
"@prisma-next/sql-relational-core": "0.13.0-dev.1",
|
|
16
|
+
"@prisma-next/sql-runtime": "0.13.0-dev.1",
|
|
17
|
+
"@prisma-next/sql-schema-ir": "0.13.0-dev.1",
|
|
18
18
|
"@standard-schema/spec": "^1.1.0",
|
|
19
19
|
"arktype": "^2.2.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@prisma-next/adapter-postgres": "0.
|
|
23
|
-
"@prisma-next/cli": "0.
|
|
24
|
-
"@prisma-next/operations": "0.
|
|
25
|
-
"@prisma-next/postgres": "0.
|
|
26
|
-
"@prisma-next/sql-contract-ts": "0.
|
|
27
|
-
"@prisma-next/target-postgres": "0.
|
|
28
|
-
"@prisma-next/test-utils": "0.
|
|
29
|
-
"@prisma-next/tsconfig": "0.
|
|
30
|
-
"@prisma-next/tsdown": "0.
|
|
31
|
-
"tsdown": "0.22.
|
|
22
|
+
"@prisma-next/adapter-postgres": "0.13.0-dev.1",
|
|
23
|
+
"@prisma-next/cli": "0.13.0-dev.1",
|
|
24
|
+
"@prisma-next/operations": "0.13.0-dev.1",
|
|
25
|
+
"@prisma-next/postgres": "0.13.0-dev.1",
|
|
26
|
+
"@prisma-next/sql-contract-ts": "0.13.0-dev.1",
|
|
27
|
+
"@prisma-next/target-postgres": "0.13.0-dev.1",
|
|
28
|
+
"@prisma-next/test-utils": "0.13.0-dev.1",
|
|
29
|
+
"@prisma-next/tsconfig": "0.13.0-dev.1",
|
|
30
|
+
"@prisma-next/tsdown": "0.13.0-dev.1",
|
|
31
|
+
"tsdown": "0.22.1",
|
|
32
32
|
"typescript": "5.9.3",
|
|
33
|
-
"vitest": "4.1.
|
|
33
|
+
"vitest": "4.1.8"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@prisma-next/adapter-postgres": "0.
|
|
36
|
+
"@prisma-next/adapter-postgres": "0.13.0-dev.1",
|
|
37
37
|
"typescript": ">=5.9"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
package/src/contract.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
} from '@prisma-next/sql-contract/types';
|
|
24
24
|
import type {
|
|
25
25
|
Contract as ContractType,
|
|
26
|
-
|
|
26
|
+
ContractModelDefinitions,
|
|
27
27
|
ExecutionHashBase,
|
|
28
28
|
NamespaceId,
|
|
29
29
|
ProfileHashBase,
|
|
@@ -31,7 +31,7 @@ import type {
|
|
|
31
31
|
} from '@prisma-next/contract/types';
|
|
32
32
|
|
|
33
33
|
export type StorageHash =
|
|
34
|
-
StorageHashBase<'sha256:
|
|
34
|
+
StorageHashBase<'sha256:8ac1bfb344d599a74f9b5f6870cdddb912706594dc90228038ef218fd9a45965'>;
|
|
35
35
|
export type ExecutionHash = ExecutionHashBase<string>;
|
|
36
36
|
export type ProfileHash =
|
|
37
37
|
ProfileHashBase<'sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb'>;
|
|
@@ -56,10 +56,15 @@ type ContractBase = Omit<
|
|
|
56
56
|
ContractType<
|
|
57
57
|
{
|
|
58
58
|
readonly namespaces: {
|
|
59
|
+
readonly __unbound__: {
|
|
60
|
+
readonly id: '__unbound__';
|
|
61
|
+
readonly kind: 'postgres-unbound-schema';
|
|
62
|
+
readonly entries: { readonly table: {}; readonly type: Record<string, never> };
|
|
63
|
+
};
|
|
59
64
|
readonly public: {
|
|
60
65
|
readonly id: 'public';
|
|
61
|
-
readonly kind: '
|
|
62
|
-
readonly
|
|
66
|
+
readonly kind: 'postgres-schema';
|
|
67
|
+
readonly entries: { readonly table: {}; readonly type: Record<string, never> };
|
|
63
68
|
};
|
|
64
69
|
};
|
|
65
70
|
readonly types: {
|
|
@@ -108,7 +113,8 @@ type ContractBase = Omit<
|
|
|
108
113
|
readonly profileHash: ProfileHash;
|
|
109
114
|
};
|
|
110
115
|
|
|
116
|
+
export type Models = ContractModelDefinitions<Contract>;
|
|
117
|
+
|
|
111
118
|
export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
|
|
112
119
|
|
|
113
120
|
export type Namespaces = Contract['storage']['namespaces'];
|
|
114
|
-
export type Models = ContractModelsMap<Contract>;
|
package/src/contract.json
CHANGED
|
@@ -13,19 +13,27 @@
|
|
|
13
13
|
},
|
|
14
14
|
"storage": {
|
|
15
15
|
"namespaces": {
|
|
16
|
+
"__unbound__": {
|
|
17
|
+
"entries": {
|
|
18
|
+
"table": {}
|
|
19
|
+
},
|
|
20
|
+
"id": "__unbound__",
|
|
21
|
+
"kind": "postgres-unbound-schema"
|
|
22
|
+
},
|
|
16
23
|
"public": {
|
|
24
|
+
"entries": {
|
|
25
|
+
"table": {}
|
|
26
|
+
},
|
|
17
27
|
"id": "public",
|
|
18
|
-
"kind": "postgres-schema"
|
|
19
|
-
"tables": {}
|
|
28
|
+
"kind": "postgres-schema"
|
|
20
29
|
}
|
|
21
30
|
},
|
|
22
|
-
"storageHash": "sha256:
|
|
31
|
+
"storageHash": "sha256:8ac1bfb344d599a74f9b5f6870cdddb912706594dc90228038ef218fd9a45965",
|
|
23
32
|
"types": {
|
|
24
33
|
"vector": {
|
|
25
34
|
"codecId": "pg/vector@1",
|
|
26
35
|
"kind": "codec-instance",
|
|
27
|
-
"nativeType": "vector"
|
|
28
|
-
"typeParams": {}
|
|
36
|
+
"nativeType": "vector"
|
|
29
37
|
}
|
|
30
38
|
}
|
|
31
39
|
},
|