Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What about DDL, for example creating or altering a table or an index? Will LiteStream replicate the operation?


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.


Thanks 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


Yep! 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.


Yes, 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

I agree this is quite unexpected for anyone used to PostgreSQL :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: