@prisma-next/extension-pgvector 0.9.0 → 0.10.0-dev.2
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.mjs +9 -6
- package/dist/control.mjs.map +1 -1
- package/package.json +20 -20
- package/src/contract.d.ts +9 -4
- package/src/contract.json +5 -4
package/dist/control.mjs
CHANGED
|
@@ -3,7 +3,7 @@ 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:06733db8971afcf2fb373dcd1278e801e9e1e083d6f07d07bc7479e143c938e3",
|
|
7
7
|
labels: [],
|
|
8
8
|
providedInvariants: ["pgvector:install-vector-v1"],
|
|
9
9
|
createdAt: "2026-06-01T00:00:00.000Z",
|
|
@@ -12,7 +12,7 @@ var migration_default = {
|
|
|
12
12
|
"applied": [],
|
|
13
13
|
"plannerVersion": "2.0.0"
|
|
14
14
|
},
|
|
15
|
-
migrationHash: "sha256:
|
|
15
|
+
migrationHash: "sha256:ff4ad2e6c7af025eafc529c7194a81bf2e2d760939892dc49e81fc701088f262"
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region migrations/20260601T0000_install_vector_extension/ops.json
|
|
@@ -45,7 +45,7 @@ var ops_default = [{
|
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region migrations/refs/head.json
|
|
47
47
|
var head_default = {
|
|
48
|
-
hash: "sha256:
|
|
48
|
+
hash: "sha256:06733db8971afcf2fb373dcd1278e801e9e1e083d6f07d07bc7479e143c938e3",
|
|
49
49
|
invariants: ["pgvector:install-vector-v1"]
|
|
50
50
|
};
|
|
51
51
|
//#endregion
|
|
@@ -58,9 +58,12 @@ var contract_default = {
|
|
|
58
58
|
roots: {},
|
|
59
59
|
models: {},
|
|
60
60
|
storage: {
|
|
61
|
-
"namespaces": { "
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
"namespaces": { "__unbound__": {
|
|
62
|
+
"id": "__unbound__",
|
|
63
|
+
"kind": "postgres-unbound-schema",
|
|
64
|
+
"tables": {}
|
|
65
|
+
} },
|
|
66
|
+
"storageHash": "sha256:06733db8971afcf2fb373dcd1278e801e9e1e083d6f07d07bc7479e143c938e3",
|
|
64
67
|
"types": { "vector": {
|
|
65
68
|
"codecId": "pg/vector@1",
|
|
66
69
|
"kind": "codec-instance",
|
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,OAAO,IAAI,UAAU,GACvE,OAAO;CAIT,OAAO,IAAI,IADY,IAAI,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,GACvC;;AAGxB,MAAM,0BAA6C;CACjD,mBAAmB,EAAE,YAAY,iBAAiB;EAChD,MAAM,SAAS,aAAa;EAC5B,IAAI,OAAO,WAAW,YAAY,OAAO,UAAU,OAAO,IAAI,SAAS,GACrE,OAAO,GAAG,WAAW,GAAG,OAAO;EAEjC,OAAO;;CAET,uBAAuB,EAAE,iBAAiB,yBAAyB,WAAW;CAC/E;AAED,MAAM,wBAAwB,sBAA4C;CACxE,cAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;EACV,KAAKC;EACN,CACF;CACD,SAAA;CACD,CAAC;AAEF,MAAM,8BAAyE;CAC7E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,OAAO;EACL,GAAG,iBAAiB;EACpB,YAAY;GACV,GAAG,iBAAiB,MAAM;GAC1B,mBAAmB,GAChB,oBAAoB,yBACtB;GACF;EACF;CACD,uBAAuB,yBAAyB;CAChD,eAAe;EACb,UAAU;EACV,UAAU;EACX;CACF"}
|
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/extension-pgvector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-dev.2",
|
|
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.10.0-dev.2",
|
|
9
|
+
"@prisma-next/contract-authoring": "0.10.0-dev.2",
|
|
10
|
+
"@prisma-next/family-sql": "0.10.0-dev.2",
|
|
11
|
+
"@prisma-next/framework-components": "0.10.0-dev.2",
|
|
12
|
+
"@prisma-next/migration-tools": "0.10.0-dev.2",
|
|
13
|
+
"@prisma-next/sql-contract": "0.10.0-dev.2",
|
|
14
|
+
"@prisma-next/sql-operations": "0.10.0-dev.2",
|
|
15
|
+
"@prisma-next/sql-relational-core": "0.10.0-dev.2",
|
|
16
|
+
"@prisma-next/sql-runtime": "0.10.0-dev.2",
|
|
17
|
+
"@prisma-next/sql-schema-ir": "0.10.0-dev.2",
|
|
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/sql-contract-ts": "0.
|
|
26
|
-
"@prisma-next/target-postgres": "0.
|
|
27
|
-
"@prisma-next/test-utils": "0.
|
|
28
|
-
"@prisma-next/tsconfig": "0.
|
|
29
|
-
"@prisma-next/tsdown": "0.
|
|
22
|
+
"@prisma-next/adapter-postgres": "0.10.0-dev.2",
|
|
23
|
+
"@prisma-next/cli": "0.10.0-dev.2",
|
|
24
|
+
"@prisma-next/operations": "0.10.0-dev.2",
|
|
25
|
+
"@prisma-next/sql-contract-ts": "0.10.0-dev.2",
|
|
26
|
+
"@prisma-next/target-postgres": "0.10.0-dev.2",
|
|
27
|
+
"@prisma-next/test-utils": "0.10.0-dev.2",
|
|
28
|
+
"@prisma-next/tsconfig": "0.10.0-dev.2",
|
|
29
|
+
"@prisma-next/tsdown": "0.10.0-dev.2",
|
|
30
30
|
"tsdown": "0.22.0",
|
|
31
31
|
"typescript": "5.9.3",
|
|
32
32
|
"vitest": "4.1.6"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@prisma-next/adapter-postgres": "0.
|
|
35
|
+
"@prisma-next/adapter-postgres": "0.10.0-dev.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@prisma-next/adapter-postgres": {
|
package/src/contract.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ import type {
|
|
|
27
27
|
} from '@prisma-next/contract/types';
|
|
28
28
|
|
|
29
29
|
export type StorageHash =
|
|
30
|
-
StorageHashBase<'sha256:
|
|
30
|
+
StorageHashBase<'sha256:06733db8971afcf2fb373dcd1278e801e9e1e083d6f07d07bc7479e143c938e3'>;
|
|
31
31
|
export type ExecutionHash = ExecutionHashBase<string>;
|
|
32
32
|
export type ProfileHash =
|
|
33
33
|
ProfileHashBase<'sha256:1a8dbe044289f30a1de958fe800cc5a8378b285d2e126a8c44b58864bac2c18e'>;
|
|
@@ -50,7 +50,13 @@ export type TypeMaps = TypeMapsType<
|
|
|
50
50
|
|
|
51
51
|
type ContractBase = ContractType<
|
|
52
52
|
{
|
|
53
|
-
readonly
|
|
53
|
+
readonly namespaces: {
|
|
54
|
+
readonly __unbound__: {
|
|
55
|
+
readonly id: '__unbound__';
|
|
56
|
+
readonly kind: 'sql-namespace';
|
|
57
|
+
readonly tables: {};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
54
60
|
readonly types: {
|
|
55
61
|
readonly vector: {
|
|
56
62
|
readonly kind: 'codec-instance';
|
|
@@ -59,7 +65,6 @@ type ContractBase = ContractType<
|
|
|
59
65
|
readonly typeParams: Record<string, never>;
|
|
60
66
|
};
|
|
61
67
|
};
|
|
62
|
-
readonly namespaces: { readonly __unspecified__: { readonly id: '__unspecified__' } };
|
|
63
68
|
readonly storageHash: StorageHash;
|
|
64
69
|
},
|
|
65
70
|
Record<string, never>
|
|
@@ -89,5 +94,5 @@ type ContractBase = ContractType<
|
|
|
89
94
|
|
|
90
95
|
export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
|
|
91
96
|
|
|
92
|
-
export type
|
|
97
|
+
export type Namespaces = Contract['storage']['namespaces'];
|
|
93
98
|
export type Models = Contract['models'];
|
package/src/contract.json
CHANGED
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
"models": {},
|
|
8
8
|
"storage": {
|
|
9
9
|
"namespaces": {
|
|
10
|
-
"
|
|
11
|
-
"id": "
|
|
10
|
+
"__unbound__": {
|
|
11
|
+
"id": "__unbound__",
|
|
12
|
+
"kind": "postgres-unbound-schema",
|
|
13
|
+
"tables": {}
|
|
12
14
|
}
|
|
13
15
|
},
|
|
14
|
-
"storageHash": "sha256:
|
|
15
|
-
"tables": {},
|
|
16
|
+
"storageHash": "sha256:06733db8971afcf2fb373dcd1278e801e9e1e083d6f07d07bc7479e143c938e3",
|
|
16
17
|
"types": {
|
|
17
18
|
"vector": {
|
|
18
19
|
"codecId": "pg/vector@1",
|