Rusqlite Migration

 cljoly/rusqlite_migration Rusqlite Migration is a simple and performant schema migration library for rusqlite. Performance: Fast database opening: to keep track of the current migration state, most tools create one or more tables in the database. These tables require parsing by SQLite and are queried with SQL statements. This library uses the user_version value instead. It’s much lighter as it is just an integer at a fixed offset in the SQLite file....

SQLite Pragma Cheatsheet for Performance and Consistency

TL;DR When Opening the DB PRAGMA journal_mode = wal; -- different implementation of the atomicity properties PRAGMA synchronous = normal; -- synchronise less often to the filesystem PRAGMA foreign_keys = on; -- check foreign key reference, slightly worst performance And check user_version to apply any migrations, for instance with this Rust library. When Closing the DB PRAGMA analysis_limit=400; -- make sure pragma optimize does not take too long PRAGMA optimize; -- gather statistics to improve query optimization Introduction SQL pragma are statements (like SELECT … or CREATE TABLE …) that change the database behaviors or call a special functions....

May 7, 2021 · 6 min