Skip to content

Commit 6912e2f

Browse files
authored
Update README.md
1 parent c5f5c9e commit 6912e2f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
```
179+
var db = new SQLiteConnection(filePath);
180+
db.Execute($"PRAGMA key = '{key}';");
181+
```
182+
183+
And use the db as usual.

0 commit comments

Comments
 (0)