Skip to content

Comment on SQLite Foreign Key Support (arriving in 3.6.19)parent

Comments

A common benefit of foreign keys is to allow cascading deletes (haven't read if this new SQLite FK enables this).

This is usually a performance benefit for the DB and app processes. It also helps to not_repeat_yourself by having the "business rule" in only one place.

We use triggers to do cascading deletes in sqlite3 without foreign keys. It's not as concise or declarative as a foreign key constraint, though.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.