8 ms·
Good question. Litestream does physical replication so it simply copies the underlying pages of the database. That means it’ll work with any database changes in
by benbjohnson 4y ago
Good question. Litestream does physical replication so it simply copies the underlying pages of the database. That means it’ll work with any database changes including DDL or even extensions.
One exception to that is encrypted databases like SQLCipher since Litestream needs to be able to read some metadata from the database.
- ngrilly 4y agoThanks Ben! I wasn’t sure if SQLite was storing metadata using the same B-Tree and WAL. As usual with SQLite the documentation about this is excellent: https://sqlite.org/schematab.html https://sqlite.org/schematab.html
- benbjohnson 4y agoYep! The schema storage is kinda wild. They store the DDL for the creation of the objects as the raw SQL which is quite a bit different than how something like Postgres has a bunch of tables in the pg_catalog to specify the database structure.
- ngrilly 4y agoYes, and that’s what makes ALTER TABLE a bit difficult to implement in SQLite, but that’s also simplifying the implementation: https://sqlite.org/lang_altertable.html https://sqlite.org/lang_altertable.html I agree this is quite unexpected for anyone used to PostgreSQL :)