News for hackers. Stuff that matters.
Re:Litestream VFS by zackify on Thursday December 11, 2025 @04:33PM (#46237465)
This is great... just got it working using bun:sqlite! Just need to have "LITESTREAM_REPLICA_URL" and the key id and secret env vars set when running the script.

  import { Database } from "bun:sqlite";
  Database.setCustomSQLite("/opt/homebrew/opt/sqlite/lib/libsqlite3.dylib");

  // Load extension first with a temp db
  const temp = new Database(":memory:");
  temp.loadExtension("/path/to/litestream.dylib", "sqlite3_litestreamvfs_init");

  // Now open with litestream VFS
  const db = new Database("file:my.db?vfs=litestream");

  const fruits = db.query("SELECT * FROM fruits;").all();
  console.log(fruits);
Re:Litestream VFS by seigel on Thursday December 11, 2025 @06:26PM (#46238807)
Cool that you got this to work! How did you get the "dylib" location or file.
Re:Litestream VFS by ricardobeat on Thursday December 11, 2025 @07:26PM (#46239364)

    brew list sqlite
gives you the installed path, works for any formula.
Re:Litestream VFS by seigel on Thursday December 11, 2025 @08:31PM (#46239838)
Neat. What I wasn't able to find was the dynamic library, just the `litestream` executable. Was there some secret you used for the litestream dylib? Thanks in advance!
Re:Litestream VFS by ricardobeat on Thursday December 11, 2025 @08:37PM (#46239877)
Looks like you need to build it yourself: https://litestream.io/guides/vfs/
Re:Litestream VFS by seigel on Thursday December 11, 2025 @08:49PM (#46239955)
Got it....you beat me to it. I had just figured that part out!! I didn't understand that part. ALSO, and this might be helpful for others, in the releases section, if you expand the little blue link at the bottom that says something like "see the other 35 assets", then the VFS extension will be downloadable from there!

Thanks for humouring me! :D

Re:Litestream VFS by zackify on Thursday December 11, 2025 @08:30PM (#46239832)
The litestream one, from the litestream github releases page!
Re:Litestream VFS by koeng on Thursday December 11, 2025 @09:06PM (#46240074)
Neat! Would this mainly be used for JavaScript servers running bun (ie, not end users)?
Re:Litestream VFS by zackify on Saturday December 13, 2025 @10:43PM (#46260585)
Correct in this case if you wanted many small edge nodes on fly.io or elsewhere to do read queries
Re:Litestream VFS by seigel on Thursday December 11, 2025 @09:28PM (#46240209)
For anyone following this example, one thing to note that I figured out the hard way is that this line from @zackify SHOULD BE HIGHTLIGHTED...

* "Just need to have "LITESTREAM_REPLICA_URL" and the key id and secret env vars set when running the script"

... and that attempting to load the variables using `dotenv` will not work!!