Skip to content

Commit

Permalink
Add changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Jan 10, 2025
1 parent 935088b commit ee5bdd9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
3 changes: 3 additions & 0 deletions sqlite3/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
systems.
- Add `jsonb`, a Dart `Codec` converting Dart object from and to SQLite
`JSONB` values.
- __Experimentally__ support encryption on the web through SQLite Multiple
Ciphers. The readme provides more information on how to use encryption on the
web.

## 2.5.0

Expand Down
24 changes: 22 additions & 2 deletions sqlite3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Emscripten or any JavaScript glue code.

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

### Setup

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

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

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

### Web encryption

Starting from version 2.6.0, `package:sqlite3/wasm.dart` supports loading a compiled version of
[SQLite Multiple Ciphers](https://utelle.github.io/SQLite3MultipleCiphers/) providing encryption
support for the web.
Please note that this variant is not currently tested as well as the regular SQLite version.
For this reason, using SQLite Multiple Ciphers with `package:sqlite3/wasm.dart` should be considered
experimental for the time being.

To test the encryption integration, download `sqlite3mc.wasm` from the [releases](https://github.com/simolus3/sqlite3.dart/releases)
of this package and use that as a URL to load sqlite3 on the web:

```dart
final sqlite3 = await WasmSqlite3.loadFromUrl(Uri.parse('sqlite3mc.wasm'));
sqlite3.registerVirtualFileSystem(InMemoryFileSystem(), makeDefault: true);
final database = sqlite3.open('/database')
..execute("pragma key = 'test';"); // TODO: Replace key
```

### Testing

To run the tests of this package with wasm, either download the `sqlite3.wasm` file from the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/sbooth/CSQLite.git",
"state" : {
"revision" : "f9bc82fd757667a5d1819db4fbb073c97488eb85",
"version" : "3.47.1"
"revision" : "c10dbeae1ea2bee3acd571c47509d6aaed1e9b92",
"version" : "3.47.2"
}
}
],
Expand Down

0 comments on commit ee5bdd9

Please sign in to comment.