feat(sql) Adding support for Sqlite database encryption + Other pragma (journal, read only...) + In memory database #1044
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi everyone,
Here is a pull request referring to issues #7 #875 and PR #877 (in-memory database).
This is my first pull request, and I'm very new to rust so if the code and PR are not well written/formatted please feel free to edit it.
I propose a way to specify SqlLite options similarly to Migrations. For this I had to review also how non-existing database are created. Here is how it works:
Sqlite options
Adding Sqlite options
Similarly as adding migrations, it is possible to add Sqlite options such as database encryption or regular Sqlite options.
All the options are specified in the struct definition
In memory
A database name containing :memory will be loaded as an in-memory database.
SqlCipher
To make it work with SqlCipher, you'll need to make additionnal changes to you cargo.toml:
You'll also need openssl to build. Please refer to libsqlite3-sys documentation to understand how to build.
On windows, I recommend building and installing openssl using vcpkg https://github.com/Microsoft/vcpkg