Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not loading in BUN #123

Open
alfonsomenkel opened this issue Feb 17, 2024 · 2 comments
Open

Not loading in BUN #123

alfonsomenkel opened this issue Feb 17, 2024 · 2 comments

Comments

@alfonsomenkel
Copy link

Bun has a builtin SQLite server. Following the instructions of node and Deno, the vertor0 loads and can see the log, bust vss0 doesn't, just stays there, no error no nothing. Any ideas?

@xiankai
Copy link

xiankai commented Apr 6, 2024

I was able to get bun to work with the standard instructions here: https://alexgarcia.xyz/sqlite-vss/nodejs.html

import Database from 'bun:sqlite'
import * as sqlite_vss from 'sqlite-vss'

const db = new Database(':memory:')
sqlite_vss.load(db)

const version = db.query(`select vss_version();`).get()
console.log(version) // { 'vss_version()': 'v0.1.2' }

@alfonsomenkel
Copy link
Author

alfonsomenkel commented Apr 10, 2024

Hi,

I tried that before, but I tried it again just in case, but the same result. I'm using Mac OS and on Mac you have to use Database.setCustomSQLite to set the correct version of sqlite. My code is:

import * as sqlite_vss from 'sqlite-vss'
import Database from 'bun:sqlite'
Database.setCustomSQLite("/usr/local/Cellar/sqlite/3.45.2/lib/libsqlite3.0.dylib");

const db = new Database('test.db')
sqlite_vss.load(db)

const version = db.query(`select vss_version()`).get()
console.log(version) // { 'vss_version()': 'v0.1.2' 

As you can see, the code is almost the same except for the Mac part and the db. I don't know if it's a problem with the sqlite-vss, bun, Mac, sqlite or a skill issue, but as I don't get an error or anything and I don't know how to find out, but will keep trying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants