Hi everyone, I’m looking for an official or commu...
# multiplatform
p
Hi everyone, I’m looking for an official or community-supported solution for implementing an encrypted database in a KMM project that works on both Android and iOS, ideally using shared/common code. From what I’ve seen, SQLDelight appears to support this to some extent, but I haven’t been able to find any up-to-date or complete guides for setting it up across both platforms, especially with encryption. If anyone has recommendations, working examples, or best practices for this setup, I’d really appreciate it! Thanks in advance!
r
Please check this. I used SQLDelight for encryption and decryption in CMP. It seem to works in my case.
🦠 2
👀 1
p
Will check, thanks a lot
j
Encryption happens below SQL Delight, so it doesn't really know (or care) whether or not you are using an encrypted DB.
p
Thanks @jw! That makes sense, I understand that SQLDelight itself is agnostic to the underlying SQLite implementation, including encryption. That said, would it be feasible (or reasonable) for SQLDelight to offer a built-in way to configure encrypted drivers? Right now, it feels like there’s a bit of a gap between what SQLDelight generates and how encrypted drivers need to be wired up manually, especially on iOS. Disclaimer: I’m bringing this up specifically because SQLDelight is the #1 go-to solution for database implementation in Kotlin Multiplatform projects, and it’d be amazing if it could also help standardize encryption workflows across platforms.
e
I haven't done it on ios yet, but on Android it is relatively simple to wrap around SqlCipher. I've been meaning to make a library for this for a while now, but I haven't had the spare time.
j
I would not count on SQLDelight offering anything in this space.
👍 1