How to enable foreign keys? PRAGMA statement?
See original GitHub issueHi, Ive noticed my ON CASCADE DELETE
doesnt work, is it because of foreign keys being turned off on android by default? If so, how can turn them on?
Naively putting them at the top of Foo.sq file PRAGMA foreign_keys = ON;
does not compile, and PRAGMA foreign_keys = 1;
does not work
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
SQLite Foreign Key Support
The application can also use a PRAGMA foreign_keys statement to determine if foreign keys are currently enabled. The following command-line ...
Read more >How do I activate foreign keys in C, using sqlite?
The PRAGMA foreign_keys command is a no-op in this configuration. If OMIT_FOREIGN_KEY is defined, then foreign key definitions cannot even be parsed (attempting ......
Read more >SQLite Foreign Key: Enforce Relationships Between Tables
If the SQLite library is compiled with foreign key constraint support, the application can use the PRAGMA foreign_keys command to enable or disable...
Read more >SQLite: Foreign Keys
You can not use the ALTER TABLE statement to add a foreign key in SQLite. Instead you will need to rename the table,...
Read more >Foreign Key constraints
You can use the spatialite-gui tools as well, if you wish. Step #2: spatialite> PRAGMA foreign_keys;. 1. By default any SQLite connection starts...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For future readers
I’m doing
driver.execute(null, "PRAGMA foreign_keys=ON", 0)