I have been trying to implement the paradigm of using Triggers to emulate 
referential integrity, for example cascading updates and 
deletes between two database tables. This works when the two database tables 
are in “main” but when I try to create the triggers 
between database tables in attached database tables, the create doesn’t work. 
Tried several iterations and couldn’t come up with the 
proper SQL syntax to do this. Is there a way to do this, add referential 
integrity triggers with database tables in attached databases?

Even better, if/when is SQLite going to support built-in referential integrity 
using foreign key constraints in the SQL when creating 
the tables? Can it support referential integrity with attached database tables?

Example use case: “main” containing an “AccountTable”, and a daily 
transactional table “YYYY-MM-DD.db3” that will be attached to “main” 
that contains a TransactionTable that has a “foreign key relation” to the 
“AccountTable” by having an account primary key as a foreign 
key in the transaction table.


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to