I'm looking for database encryption support,
Is this planned for this library?
This would depend on the underlying database engine. Moor currently uses the sqflite package internally, which doesn't support encryption.
There are some forks which seem to support encryption, but I'm not sure if any of them works well enough. In theory, all that needs to be done is changing this file to use such fork.
On the develop branch, we now have the encrypted_moor library that supports encryption in the extras/encryption folder. It uses sqflite_sqlcipher as implementation. That library isn't on pub, so the moor bindings probably won't be either - the folder contains instructions on how to use the library.
The encrypted version won't work with the current moor version (1.6), but it will work with the next version. I'll keep the library updated to always work with the latest version of moor after that, and hopefully write some integration tests to verify that soon.
As an alternative, when dart:ffi gets stable and we can ship our own bindings, using SQLCipher might be a viable alternative in the future.
On the
developbranch, we now have theencrypted_moorlibrary that supports encryption in theextras/encryptionfolder. It uses sqflite_sqlcipher as implementation. That library isn't on pub, so the moor bindings probably won't be either - the folder contains instructions on how to use the library.
The encrypted version won't work with the current moor version (1.6), but it will work with the next version. I'll keep the library updated to always work with the latest version of moor after that, and hopefully write some integration tests to verify that soon.As an alternative, when
dart:ffigets stable and we can ship our own bindings, using SQLCipher might be a viable alternative in the future.
Looking forward for the encryption feature.
Now that moor 1.7 is released, you can try out an encrypted version by following the instructions at https://github.com/simolus3/moor/tree/master/extras/encryption. The EncryptedExecutor has a password parameter in its constructor which will be used to encrypt the database. As we just change the underlying database engine, all features supported by moor_flutter are supported on that version as well.
As always, if you have any questions or problems, feel free to reply here or open another issue, thanks!
Most helpful comment
Now that moor 1.7 is released, you can try out an encrypted version by following the instructions at https://github.com/simolus3/moor/tree/master/extras/encryption. The
EncryptedExecutorhas apasswordparameter in its constructor which will be used to encrypt the database. As we just change the underlying database engine, all features supported bymoor_flutterare supported on that version as well.As always, if you have any questions or problems, feel free to reply here or open another issue, thanks!