Summary: found in this guide, you will then see making use of the SQLite foreign key constraint to enforce the interactions between related dining tables.
SQLite unknown important restriction support
SQLite has actually recognized foreign important constraint since variant 3.6.19. The SQLite archive should be gathered with neither SQLITE_OMIT_FOREIGN_KEY nor SQLITE_OMIT_TRIGGER.
To determine whether your present model of SQLite supporting international principal constraints or don’t, make use of here management.
The management comes back an integer benefits: 1: enable, 0: impaired. If the management income almost nothing, it is meaning that your particular SQLite model really doesnat support international key regulations.
If your SQLite archive are collected with overseas secret constraint support, the required forms will use the PRAGMA foreign_keys management make it possible for or disable foreign trick limitations at runtime.
Summary of the SQLite international important restrictions
Letas focus on two dining tables: sellers and supplier_groups :
Let’s assume that each dealer belongs to one and only one trader team. And every one vendor cluster may have zero or lots of retailers. The partnership between supplier_groups and suppliers dining tables is definitely one-to-many. Put simply, for each and every line inside manufacturers dining table, there exists a corresponding row into the supplier_groups counter.
Presently, there is no way to keep you from introducing a row to the sellers desk without a related line inside supplier_groups table. Leia mais