SQLite Bootstrap Provider
Overview
drasi-bootstrap-sqlite provides initial snapshot loading for SQLite-backed sources by reading table rows and emitting SourceChange::Insert bootstrap events.
Key capabilities:
- file-backed SQLite snapshot loading
- optional table allow-list
- table key override support for stable element IDs
- automatic PK detection via
PRAGMA table_info
Usage
use ;
let bootstrap = builder
.with_path
.with_tables
.with_table_keys
.build;
Attach the provider in SqliteSource::builder(...).with_bootstrap_provider(bootstrap).
Configuration Options
| Property | Type | Default | Description |
|---|---|---|---|
path |
String? |
null |
SQLite file path. Omit for in-memory (bootstrap will be skipped) |
tables |
Vec<String>? |
null |
Optional table allow-list. null means all user tables |
tableKeys |
Vec<TableKeyConfig> |
[] |
Manual primary key configuration |
TableKeyConfig
| Field | Type | Description |
|---|---|---|
table |
String |
Table name |
keyColumns |
Vec<String> |
Column names to use as primary key |
Behavior
- For file-backed databases, the provider opens a read-only connection and streams table rows.
- For in-memory databases, bootstrap is skipped (no independent snapshot connection exists).
- Labels map directly to table names.
- Element IDs use configured keys first, then detected PK columns.
Testing
Bootstrap behavior is also validated through drasi-source-sqlite ignored integration tests.