SQLite-backed tape store plugin for bub.
- Bub plugin entry point:
tapestore-sqlite - A
provide_tape_storehook implementation backed by SQLite - One database file for all tapes instead of one JSONL file per tape
- Native SQLite indexes for tape listing, anchor lookup, and kind filtering
uv pip install "git+https://github.com/bubbuild/bub-contrib.git#subdirectory=packages/bub-tapestore-sqlite"You can also install it with Bub:
bub install bub-tapestore-sqlite@mainNote:
bub-tapestore-sqlitecurrently supportsbub0.3.1and later.
The plugin reads environment variables with prefix BUB_SQLITE_:
BUB_SQLITE_PATH(optional): database path- Default:
<BUB_HOME>/tapes.sqlite3
- Default:
BUB_SQLITE_BUSY_TIMEOUT_MS(optional, default:5000)BUB_SQLITE_JOURNAL_MODE(optional, default:WAL)BUB_SQLITE_SYNCHRONOUS(optional, default:NORMAL)BUB_SQLITE_EMBEDDING_MODEL(optional): any-llm model identifier, for exampleopenai:text-embedding-3-small
- The plugin overrides Bub's builtin file-based tape store through
provide_tape_store. - Default database location:
<BUB_HOME>/tapes.sqlite3. - Entry IDs come from the autoincrement
tape_entries.idcolumn. - Query behavior matches Bub tape queries:
all()after_anchor(...)last_anchor()between_anchors(...)kinds(...)limit(...)
- Optional vector search:
- Message entries are indexed lazily when you call
await TapeQuery(tape, store).query("...").all(). - Configure
BUB_SQLITE_EMBEDDING_MODEL. - The first successful embedding call persists vector dimensions automatically from the returned embedding size.
- Semantic queries reuse the standard
fetch_all()path and still honorkinds(...),limit(...), anchor bounds, and date bounds.
- Message entries are indexed lazily when you call
- Enables
PRAGMA foreign_keys = ON - Uses
PRAGMA journal_mode = WALby default - Uses
PRAGMA synchronous = NORMALby default - Applies
PRAGMA busy_timeoutfor concurrent readers/writers in one process - Loads the bundled
sqlite-vecextension when vector search is enabled