@prisma-next/extension-pgvector 0.0.1 → 0.1.0-pr.32.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/README.md CHANGED
@@ -62,7 +62,9 @@ Add vector columns to your contract:
62
62
  ```typescript
63
63
  import { defineContract } from '@prisma-next/sql-contract-ts/contract-builder';
64
64
  import type { CodecTypes } from '@prisma-next/adapter-postgres/codec-types';
65
+ import { int4Column, textColumn } from '@prisma-next/adapter-postgres/column-types';
65
66
  import type { CodecTypes as PgVectorCodecTypes } from '@prisma-next/extension-pgvector/codec-types';
67
+ import { vectorColumn } from '@prisma-next/extension-pgvector/column-types';
66
68
 
67
69
  type AllCodecTypes = CodecTypes & PgVectorCodecTypes;
68
70
 
@@ -70,9 +72,9 @@ export const contract = defineContract<AllCodecTypes>()
70
72
  .target('postgres')
71
73
  .table('post', (t) =>
72
74
  t
73
- .column('id', { type: 'pg/int4@1', nullable: false })
74
- .column('title', { type: 'pg/text@1', nullable: false })
75
- .column('embedding', { type: 'pg/vector@1', nullable: true })
75
+ .column('id', { type: int4Column, nullable: false })
76
+ .column('title', { type: textColumn, nullable: false })
77
+ .column('embedding', { type: vectorColumn, nullable: true })
76
78
  .primaryKey(['id']),
77
79
  )
78
80
  .build();
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Column type descriptors for pgvector extension.
3
+ *
4
+ * These descriptors provide both codecId and nativeType for use in contract authoring.
5
+ * They are derived from the same source of truth as codec definitions and manifests.
6
+ */
7
+ declare const vectorColumn: {
8
+ readonly codecId: "pg/vector@1";
9
+ readonly nativeType: "vector";
10
+ };
11
+
12
+ export { vectorColumn };
@@ -0,0 +1,9 @@
1
+ // src/exports/column-types.ts
2
+ var vectorColumn = {
3
+ codecId: "pg/vector@1",
4
+ nativeType: "vector"
5
+ };
6
+ export {
7
+ vectorColumn
8
+ };
9
+ //# sourceMappingURL=column-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/exports/column-types.ts"],"sourcesContent":["/**\n * Column type descriptors for pgvector extension.\n *\n * These descriptors provide both codecId and nativeType for use in contract authoring.\n * They are derived from the same source of truth as codec definitions and manifests.\n */\n\nimport type { ColumnTypeDescriptor } from '@prisma-next/contract-authoring';\n\nexport const vectorColumn = {\n codecId: 'pg/vector@1',\n nativeType: 'vector',\n} as const satisfies ColumnTypeDescriptor;\n"],"mappings":";AASO,IAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,YAAY;AACd;","names":[]}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@prisma-next/extension-pgvector",
3
- "version": "0.0.1",
3
+ "version": "0.1.0-pr.32.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "dependencies": {
7
7
  "arktype": "^2.0.0",
8
- "@prisma-next/cli": "0.0.1",
9
- "@prisma-next/sql-operations": "0.0.1",
10
- "@prisma-next/sql-relational-core": "0.0.1"
8
+ "@prisma-next/cli": "0.1.0-pr.32.2",
9
+ "@prisma-next/sql-operations": "0.1.0-pr.32.2",
10
+ "@prisma-next/sql-relational-core": "0.1.0-pr.32.2"
11
11
  },
12
12
  "devDependencies": {
13
13
  "tsup": "^8.3.0",
@@ -32,6 +32,10 @@
32
32
  "types": "./dist/exports/codec-types.d.ts",
33
33
  "import": "./dist/exports/codec-types.js"
34
34
  },
35
+ "./column-types": {
36
+ "types": "./dist/exports/column-types.d.ts",
37
+ "import": "./dist/exports/column-types.js"
38
+ },
35
39
  "./operation-types": {
36
40
  "types": "./dist/exports/operation-types.d.ts",
37
41
  "import": "./dist/exports/operation-types.js"