hmmm, looks like getting sqldelight w/ encryption ...
# multiplatform
k
hmmm, looks like getting sqldelight w/ encryption is going to be a challenge for K/N. anyone tried this?
b
you mean linking a custom sqlite?
k
sqlcipher, specifically
b
a compile-time option?
well in any case, if you need to link a custom sqlite, i know how to do that
k
are you suggesting that's the solution?
i'm not sure what other changes will be required on the native side. i haven't looked into it yet.
b
oh sqlcipher is a replacement
k
in theory the APIs are identical so it could be a drop in replacement
b
yeah so linking custom sqlite it what you want
in your sqldelight block in build.gradle, add
linkSqlite = false
then you'll have to update linker flags to link sqlcipher
getting the linker flags right is the hard part
and it varies based on how you distribute on the iOS side
k
oh, it's static. i'd need to link library into the iOS app anyway. which means it may even be possible to just use sqlcipher instead.
i'd think the exported symbols would match up. i guess i'll find out.
👍 1
gah. they don't match perfectly because you have to specify the key to the open function
b
Could you build the library with an extra open function that calls the sqlcipher one passing the key hard-coded?
k
It’s doable. Just need to sort out the details and write it up. I actually did this with j2objc and our custom driver
👍 1
Also looks like at least one person uses it: https://github.com/touchlab/SQLiter/pull/16
k
i think the original sqldelight can be forked in a minimal touch way that makes it easy to pull in upstream changes
b
Sqldecipher
k
lolz
k
Do you need a work of sqldelight, though?
b
You shouldn't if you can stub in that open function
k
well, I see it's actually using SQLiter for the native implementation, so still digging there