File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 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
1111
1212And call this statup function in each of your platform projects:
1313
14- ```
14+ ``` csharp
1515SQLitePCL .Batteries_V2 .Init ()
1616```
1717
@@ -28,7 +28,7 @@ For a simple key/value store based on sqlite, or a drop-in replacement (alternat
2828
2929* Multiple primary key support
3030 Ex:
31- ```
31+ ``` csharp
3232 public class PrivacyGroupItem
3333 {
3434 [PrimaryKey ]
@@ -168,3 +168,16 @@ The T in `db.Query<T>` specifies the object to create for each row. It can be a
168168 return db .Query <Val > (" select 'Price' as 'Money', 'Time' as 'Date' from Valuation where StockId = ?" , stock .Id );
169169 }
170170```
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