@useverk/drizzle-pgvector
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

Do

npm install @useverk/drizzle-pgvector

or

yarn add @useverk/drizzle-pgvector

or

pnpm add @useverk/drizzle-pgvector

And 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 generate will 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-kit is open-source.

Package Sidebar

Install

npm i @useverk/drizzle-pgvector

Weekly Downloads

202

Version

1.0.11

License

ISC

Unpacked Size

21.1 kB

Total Files

14

Last publish

Collaborators

  • ssardorf