Package Exports
- @useverk/drizzle-pgvector
- @useverk/drizzle-pgvector/index.ts
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@useverk/drizzle-pgvector) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Do
npm install @useverk/drizzle-pgvectoror
yarn add @useverk/drizzle-pgvectoror
pnpm add @useverk/drizzle-pgvectorAnd then in your code:
import { customVector } from '@useverk/drizzle-pgvector'
export const myTable = pgTable(
'mytable',
{
...
embedding: customVector('embedding', { dimensions: 1536 }),
...
})Known issues
running
drizzle-kit generatewill generate the following sql migration file:CREATE TABLE IF NOT EXISTS "myTable" ( "id" serial PRIMARY KEY NOT NULL, "vector" "vector(1536)" );which is not valid postgresql syntax. Simply remove the quotes around the type name to fix it. The correct syntax is:
CREATE TABLE IF NOT EXISTS "myTable" ( "id" serial PRIMARY KEY NOT NULL, "vector" vector(1536) );Will fix this once
drizzle-kitis open-source.