Skip to content

Commit 242abdd

Browse files
committed
Add changelog entry
1 parent 44c7baf commit 242abdd

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

sqlite3/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
systems.
55
- Add `jsonb`, a Dart `Codec` converting Dart object from and to SQLite
66
`JSONB` values.
7+
- __Experimentally__ support encryption on the web through SQLite Multiple
8+
Ciphers. The readme provides more information on how to use encryption on the
9+
web.
710

811
## 2.5.0
912

sqlite3/README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Emscripten or any JavaScript glue code.
9696

9797
Please note that stable web support for `package:sqlite3` is restricted to Dart
9898
being compiled to JavaScript. Support for `dart2wasm` is experimental. The API
99-
is identical, but the implementation [is severly limited](https://github.com/simolus3/sqlite3.dart/issues/230).
99+
is identical, but the implementation [is severely limited](https://github.com/simolus3/sqlite3.dart/issues/230).
100100

101101
### Setup
102102

@@ -130,7 +130,7 @@ in `package:sqlite3/sqlite3.dart`, databases can be opened in similar ways.
130130

131131
An example for such web folder is in `example/web/` of this repo.
132132
To view the example, copy a compiled `sqlite3.wasm` file to `web/sqlite3.wasm` in this directory.
133-
Then, run `dart run build_runner serve example:8080` and visit `http://localhost:8080/web/` in a browser.
133+
Then, run `dart run build_runner serve example:8080` and visit `http://localhost:8080/web/` in a browser.
134134

135135
Another `example/multiplatform/` uses common interface to `sqlite3` on web and native platforms.
136136
To run this example, merge its files into a Flutter app.
@@ -143,6 +143,26 @@ version in `package:sqlite3/wasm.dart`.
143143
By having shared code depend on the common interfaces, it can be used for both native and web
144144
apps.
145145

146+
### Web encryption
147+
148+
Starting from version 2.6.0, `package:sqlite3/wasm.dart` supports loading a compiled version of
149+
[SQLite Multiple Ciphers](https://utelle.github.io/SQLite3MultipleCiphers/) providing encryption
150+
support for the web.
151+
Please note that this variant is not currently tested as well as the regular SQLite version.
152+
For this reason, using SQLite Multiple Ciphers with `package:sqlite3/wasm.dart` should be considered
153+
experimental for the time being.
154+
155+
To test the encryption integration, download `sqlite3mc.wasm` from the [releases](https://github.com/simolus3/sqlite3.dart/releases)
156+
of this package and use that as a URL to load sqlite3 on the web:
157+
158+
```dart
159+
final sqlite3 = await WasmSqlite3.loadFromUrl(Uri.parse('sqlite3mc.wasm'));
160+
sqlite3.registerVirtualFileSystem(InMemoryFileSystem(), makeDefault: true);
161+
162+
final database = sqlite3.open('/database')
163+
..execute("pragma key = 'test';"); // TODO: Replace key
164+
```
165+
146166
### Testing
147167

148168
To run the tests of this package with wasm, either download the `sqlite3.wasm` file from the

sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)