-
Notifications
You must be signed in to change notification settings - Fork 10k
Description
Existing documentation URL(s)
In the D1 Documentation about Foreign Keys, I think there's a typo where on should be off
Specifically, the statement:
You can also explicitly set PRAGMA
defer_foreign_keys = onimmediately after you have resolved outstanding foreign key constraints. If there are still outstanding foreign key constraints, you will receive a FOREIGN KEY constraint failed error and will need to resolve the violation.
I believe that on should be off - because my understanding (which may be in error) from reading the page is that deferring (the checking of) foreign keys allows you to violate constraints, and in the example above it sets that to off (i.e. enforcing the check` at the end of the transaction:
PRAGMA defer_foreign_keys = off -- This is implicit if not set by the end of the transaction.
What changes are you suggesting?
In the statement:
You can also explicitly set PRAGMA
defer_foreign_keys = onimmediately after you have resolved outstanding foreign key constraints. If there are still outstanding foreign key constraints, you will receive a FOREIGN KEY constraint failed error and will need to resolve the violation.
I believe that on should be off so it should read:
You can also explicitly set PRAGMA
defer_foreign_keys = offimmediately after you have resolved outstanding foreign key constraints. If there are still outstanding foreign key constraints, you will receive a FOREIGN KEY constraint failed error and will need to resolve the violation.
Additional information
No response