@ryangarber/prisma-orm-extension-pgvector 8.0.0-rc.8 → 8.0.0-rc.8a

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
@@ -1,11 +1,29 @@
1
- # @prisma/orm-extension-pgvector
1
+ # @ryangarber/prisma-orm-extension-pgvector
2
2
 
3
3
  Embedding columns and vector similarity search for Prisma Next on PostgreSQL, powered by [pgvector](https://github.com/pgvector/pgvector).
4
4
 
5
5
  ```bash
6
- pnpm add @prisma/orm-extension-pgvector
6
+ pnpm add @prisma/orm-extension-pgvector@npm:@ryangarber/prisma-orm-extension-pgvector@8.0.0-rc.8a
7
7
  ```
8
8
 
9
+ Keep `@prisma/orm-extension-pgvector` as the dependency key and use the `npm:` target to select this fork. Prisma's contract emitter intentionally generates imports from the canonical package name, so the alias makes those imports resolve to this package without rewriting generated files. Application imports should use the canonical name for the same reason:
10
+
11
+ ```ts
12
+ import pgvector from '@prisma/orm-extension-pgvector/control';
13
+ ```
14
+
15
+ ## About this fork
16
+
17
+ The original extension doesn't support embeddings with variable dimensions. This package adds support for a plain `Vector()` type on top of the original `Vector(N)`.
18
+
19
+ It is intended for this fork to stay as close as possible to the original until the Prisma team (hopefully) introduces this support officially.
20
+
21
+ Versions are matched to the latest official version, plus a letter to signify patches specific to the fork:
22
+
23
+ | Official Version | Fork (Patch 1) |
24
+ | ---------------- | --------------- |
25
+ | 8.0.0-rc.8 | 8.0.0-rc.8**a** |
26
+
9
27
  ## Entrypoints
10
28
 
11
29
  | Namespace | Surface |
@@ -1,9 +1,31 @@
1
1
  import { ColumnTypeDescriptor } from "@prisma/orm-framework/components/codec";
2
2
  //#region ../../../3-extensions/pgvector/dist/column-types.d.mts
3
3
  //#region src/exports/column-types.d.ts
4
+ /**
5
+ * Factory for creating non-dimensioned vector column descriptors.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * .column('embedding', { type: vector(), nullable: false })
10
+ * // Produces: nativeType: 'vector', typeParams: {}
11
+ * ```
12
+ * @returns A column type descriptor without `typeParams.length` set
13
+ */
4
14
  declare function vector(): ColumnTypeDescriptor & {
5
15
  readonly typeParams: Record<string, never>;
6
16
  };
17
+ /**
18
+ * Factory for creating dimensioned vector column descriptors.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * .column('embedding', { type: vector(1536), nullable: false })
23
+ * // Produces: nativeType: 'vector', typeParams: { length: 1536 }
24
+ * ```
25
+ * @param length - The dimension of the vector (e.g., 1536 for OpenAI embeddings)
26
+ * @returns A column type descriptor with `typeParams.length` set
27
+ * @throws `CONTRACT.ARGUMENT_INVALID` if length is not an integer in the range [1, VECTOR_MAX_DIM]
28
+ */
7
29
  declare function vector<N extends number>(length: N): ColumnTypeDescriptor & {
8
30
  readonly typeParams: {
9
31
  readonly length: N;
@@ -1 +1 @@
1
- {"version":3,"file":"column-types.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/column-types.d.mts"],"mappings":";;;iBAEiB,UAAU;WAChB,YAAY;;iBAEN,OAAO,kBAAkB,QAAQ,IAAI;WAC3C;aACE,QAAQ"}
1
+ {"version":3,"file":"column-types.d.mts","names":[],"sources":["../../../../3-extensions/pgvector/dist/column-types.d.mts"],"mappings":";;;;;;;;;;;;;iBAYiB,UAAU;WAChB,YAAY;;;;;;;;;;;;;;iBAcN,OAAO,kBAAkB,QAAQ,IAAI;WAC3C;aACE,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@ryangarber/prisma-orm-extension-pgvector",
3
- "version": "8.0.0-rc.8",
3
+ "version": "8.0.0-rc.8a",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "license": "Apache-2.0",
5
8
  "type": "module",
6
9
  "sideEffects": false,