Can a Job Refer to a Pump We Have Never Recorded?

A row can have the right types and still contain an impossible reference. Put identity, domain and relationship rules at the database boundary.

13 sections · 4 questions · 1 coding challenge

1 / 13

Preserving Relationships Across Several Writers

BOTIE

Relational tables let records be connected through values instead of application-specific pointers. That independence makes relationship rules important: any writer can otherwise introduce a child record whose parent is absent. Foreign keys put that relationship check in the database.

SQLite’s documentation records foreign-key enforcement beginning in version 3.6.19 in 2009. It must be enabled for each connection in the configuration used here. The browser runner enables it before executing your statements. Merely seeing REFERENCES in a schema is insufficient evidence that a particular connection enforces it.

Sources for this history