https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

ciriti

06/06/2020, 8:44 AM
Hi guys, do you know if it possible to use encryption with sqldelight?
m

Mark Murphy

06/06/2020, 12:38 PM
I do not think that SQLDelight has encryption itself. Usually, the encryption is in the SQLite implementation (e.g., SQLCipher, SEE). Somebody would need to create SQLDelight drivers for that SQLite implementation. In the specific case of Android,
AndroidSqliteDriver
uses the Jetpack
androidx.sqlite
API, so you should be able to use it with SQLCipher for Android by supplying your own
SupportSQLiteOpenHelper
or
SupportSQLiteOpenHelper.Factory
to the
AndroidSqliteDriver
constructor.
1
💯 2
m

mbonnin

06/06/2020, 1:37 PM
💯 1
c

ciriti

06/06/2020, 1:58 PM
Thanks @Mark Murphy and @mbonnin
m

Mark Murphy

06/06/2020, 2:08 PM
Note that SafeRoom is no longer necessary. The current version of SQLCipher for Android supports the
androidx.sqlite
API directly.
k

kpgalligan

06/11/2020, 11:02 PM
For native, we have a ticket to create a sample using sqlcipher and sqldelight on ios. Possible, but may need some effort to make “simple”