←back to thread

317 points emschwartz | 2 comments | | HN request time: 0.442s | source
1. simonw ◴[] No.46236418[source]
This is such a clean interface design:

  export LITESTREAM_REPLICA_URL="s3://my-bucket/my.db"
  export AWS_ACCESS_KEY_ID="your-access-key"
  export AWS_SECRET_ACCESS_KEY="your-secret-key"

  sqlite3

  .load litestream.so
  .open file:///my.db?vfs=litestream
  PRAGMA litestream_time = '5 minutes ago'; 
  select * from sandwich_ratings limit 3;
replies(1): >>46237264 #
2. zackify ◴[] No.46237264[source]
For macos users,

brew install sqlite3, then change the bottom part:

  /opt/homebrew/opt/sqlite/bin/sqlite3
  .load litestream sqlite3_litestreamvfs_init
  .open file:///my.db?vfs=litestream
you have to manually pass in the init function name