You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There isn't a well-documented way to do this for the SQLDelight Multiplatform drivers that I could find. The issue at #1406 has a few links, but doesn't collect everything in a single place.
It took me some time and digging to gather everything I needed to enable foreign key constraints in my KMM project. I thought I'd open this discussion to share my findings to help others in the future. I pulled these snippets from the issues linked under each class heading.
Discussed in #3681
Originally posted by darronschall November 19, 2022
SQLite3 does not enable foreign key constraints by default.
There isn't a well-documented way to do this for the SQLDelight Multiplatform drivers that I could find. The issue at #1406 has a few links, but doesn't collect everything in a single place.
It took me some time and digging to gather everything I needed to enable foreign key constraints in my KMM project. I thought I'd open this discussion to share my findings to help others in the future. I pulled these snippets from the issues linked under each class heading.
These are all working for me in SQLDelight 1.5.4.
AndroidSqliteDriver
See: #1241 (comment)
NativeSqliteDriver
See #1356 (comment). I believe once SQLDelight 2.0.0 is released, we'll be able to simplify the NativeSqliteDriver setting per #3493.
JdbcSqliteDriver
See #2421 (comment).
(In KMM projects,
JdbcSqliteDriver
is useful for creating an in-memory database forandroidTest
tests that run via the JVM).The text was updated successfully, but these errors were encountered: