KyselyK
Kysely2y ago
29 replies
Jake

using pgvector with Kysely

Following the example here: https://github.com/pgvector/pgvector-node?darkschemeovr=1#kysely

But I get the error ERROR: column "embedding" is of type vector but expression is of type character varying

Happy to provide code if necessary but there aren’t any differences from the tutorial

Using AWS RDS 13.12 (which has pgvector support)
GitHub
pgvector support for Node.js and Bun (and TypeScript) - pgvector/pgvector-node
GitHub - pgvector/pgvector-node: pgvector support for Node.js and B...
Solution
// Replace `string` with the type you have in the table interface.
sql<string>`${sql.ref(column)} <=> ${toSql(value)}::vector(3)`
Was this page helpful?