Re:Siren Call of SQLite on the Server
by cloogshicer on Tuesday February 18, 2025 @10:16AM
(#43090461)
Interesting, thanks for sharing! This sounds like a nightmare haha
What kinds of problems does this cause in practice? Do you have any examples? Not questioning you, just curious to learn more.
SQLite's ALTER TABLE support isn't on par with other dbs. That's primarily (perhaps solely) because it stores table definitions as their raw SQL, rather than in some "idealized form." When SQLite first needs to understand a table's structure, it reads the original SQL which was used to create that table. Retroactively modifying arbitrary string input from the user (in this case SQL code) is a minefield.
Edit: see <https://www.sqlite.org/lang_altertable.html> in particular the final section, currently titled "Why ALTER TABLE is such a problem for SQLite"