7 ms·
What don't you like about SQLite views or foreign keys?
by bbkane 1mo ago
What don't you like about SQLite views or foreign keys?
- groundzeros2015 1mo agoFor example you can’t insert or update a SQLite view. I don’t even think SQLite lets you fully update a table schema. If you start trying to use it for sql and not just storing rows you run into these everywhere. SQLite is not serving the same needs as Postgres.
- bbkane 29d agoYou can use a trigger with INSTEAD OF to update a view: CREATE TRIGGER update_customer_emails_trigger INSTEAD OF UPDATE ON customer_emails BEGIN UPDATE customers SET email = new.email, name = new.name WHERE id = old.id; END; Maybe that's not as flexible as you need. SQLites process for table updates can be pretty onerous if their ALTER TABLE lacks support. Its a 12 step process the docs have the temerity to call "simple" instead of "tedious and risky" - https://www.sqlite.org/lang_altertable.html#otheralter https://www.sqlite.org/lang_altertable.html#otheralter
- groundzeros2015 28d agoYes, friction like this. It’s just not a fully featured SQL implementation. As their saying goes, it competes with fopen not oracle.