Thread with 12 posts
jump to expanded postoh my god. SQLite remembers the comment lines of your schema and stores them in the database…
oh my god. the internal representation of the schema in an SQLite database… is the SQL text itself. that's why it contains the CREATE TABLE statement in plaintext… https://www.sqlite.org/lang_altertable.html#why_alter_table_is_such_a_problem_for_sqlite
@hikari lmao, what
@hikari Yup.
@hikari if you need to change some properties of a column, you can do it by just UPDATEing the table containing that string; I've shipped code that does this to millions of systems
@rcombs AAAAAAAA
@hikari isn't it a tiny bit awesome though?
@hikari I'm pretty sure SQLite stores the raw "create table" statement in the database.
@jernej__s yeah, that seems to be how this works!
@hikari and presumably the schema for the schema table is hard coded in the executable.
@hikari we wrote an sqlite FFI binding library a long time ago and we still get questions about it occasionally. somebody once asked us why our wrapper didn't have a full set of types. we dug into it for a bit and remembered that type names in sqlite are purely decorative.
@hikari it's a very good piece of kit for what it is, don't get us wrong.