asg017 / sqlite-vss

A SQLite extension for efficient vector search, based on Faiss!
MIT License
1.59k stars 58 forks source link

Update readme for NPM package #118

Open malipetek opened 4 months ago

malipetek commented 4 months ago

Example in npm readme for sqlite3 does not work for me using m1 and yarn This is the working setup for me

import sqlite3 from "sqlite3";
import * as sqlite_vss from "sqlite-vss";

const db = new sqlite3.Database(":memory:"); // or ./memory.sqlite or memory.db
db.loadExtension(sqlite_vss.getVectorLoadablePath());
db.loadExtension(sqlite_vss.getVssLoadablePath());

db.get("select vss_version()", (err, row) => {
  console.log(row); // {vss_version(): "v0.2.0"}
});

export default db;