File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Also add one of the https://github.com/ericsink/SQLitePCL.raw package of your ch
11
11
12
12
And call this statup function in each of your platform projects:
13
13
14
- ```
14
+ ``` csharp
15
15
SQLitePCL .Batteries_V2 .Init ()
16
16
```
17
17
@@ -28,7 +28,7 @@ For a simple key/value store based on sqlite, or a drop-in replacement (alternat
28
28
29
29
* Multiple primary key support
30
30
Ex:
31
- ```
31
+ ``` csharp
32
32
public class PrivacyGroupItem
33
33
{
34
34
[PrimaryKey ]
@@ -168,3 +168,16 @@ The T in `db.Query<T>` specifies the object to create for each row. It can be a
168
168
return db .Query <Val > (" select 'Price' as 'Money', 'Time' as 'Date' from Valuation where StockId = ?" , stock .Id );
169
169
}
170
170
```
171
+
172
+ ## Encrypting the database file
173
+
174
+ Add the nuget ` SQLitePCLRaw.bundle_e_sqlcipher ` to your project containing ` sqlite-net2 ` .
175
+
176
+ Call this right after opening or creating the db, as the 1st instruction.
177
+
178
+ ``` csharp
179
+ var db = new SQLiteConnection (filePath );
180
+ db .Execute ($" PRAGMA key = '{key }';" );
181
+ ```
182
+
183
+ And use the db as usual.
You can’t perform that action at this time.
0 commit comments