Problem
SqliteEventStore::append_events() runs a separate INSERT statement per event inside a transaction, similar to the PostgreSQL backend.
Proposed Solution
Replace the per-event INSERT loop with a single multi-row INSERT statement. SQLite supports INSERT INTO ... VALUES (...), (...), (...) syntax.
Expected Impact
Moderate improvement on larger batches. Less impactful than the PostgreSQL optimization since SQLite is in-process (no network round-trip per statement), but reducing statement preparation overhead should still help.
Location
eventcore-sqlite/src/lib.rs — append_events() method.
Benchmark Baseline
Run cargo bench -p eventcore-bench --bench store_operations -- 'store/append/sqlite' to measure before/after.
Problem
SqliteEventStore::append_events()runs a separate INSERT statement per event inside a transaction, similar to the PostgreSQL backend.Proposed Solution
Replace the per-event INSERT loop with a single multi-row INSERT statement. SQLite supports
INSERT INTO ... VALUES (...), (...), (...)syntax.Expected Impact
Moderate improvement on larger batches. Less impactful than the PostgreSQL optimization since SQLite is in-process (no network round-trip per statement), but reducing statement preparation overhead should still help.
Location
eventcore-sqlite/src/lib.rs—append_events()method.Benchmark Baseline
Run
cargo bench -p eventcore-bench --bench store_operations -- 'store/append/sqlite'to measure before/after.