pgvector / pgvector-node

pgvector support for Node.js, Deno, and Bun (and TypeScript)
MIT License
303 stars 9 forks source link

drizzle-orm integration cannot generate vector columns #21

Closed davidgomes closed 4 months ago

davidgomes commented 4 months ago

If I try to generate a PG table with a column like so:

embedding: vector('embedding', {dimensions: 1536}),

Then, the drizzle-kit generated migration will look like this:

ALTER TABLE "documents" ADD COLUMN "embedding" "vector(1536)";

This is not valid SQL in Postgres, it should be:

ALTER TABLE "documents" ADD COLUMN "embedding" vector(1536);

(Otherwise, you get ERROR: type "vector(1536)" does not exist)

I am not 100% sure if this is an issue with this extension or not, but figured I'd report it here.

ankane commented 4 months ago

Hi @davidgomes, unfortunately, this is a current limitation of Drizzle Kit (docs).

https://github.com/drizzle-team/drizzle-kit-mirror/issues/115

davidgomes commented 4 months ago

Thank you!

gvkhna commented 3 months ago

This has, i believe, finally been addressed.

https://github.com/drizzle-team/drizzle-orm/pull/2360