@@ -96,7 +96,7 @@ Emscripten or any JavaScript glue code.
96
96
97
97
Please note that stable web support for ` package:sqlite3 ` is restricted to Dart
98
98
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 ) .
100
100
101
101
### Setup
102
102
@@ -130,7 +130,7 @@ in `package:sqlite3/sqlite3.dart`, databases can be opened in similar ways.
130
130
131
131
An example for such web folder is in ` example/web/ ` of this repo.
132
132
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.
134
134
135
135
Another ` example/multiplatform/ ` uses common interface to ` sqlite3 ` on web and native platforms.
136
136
To run this example, merge its files into a Flutter app.
@@ -143,6 +143,26 @@ version in `package:sqlite3/wasm.dart`.
143
143
By having shared code depend on the common interfaces, it can be used for both native and web
144
144
apps.
145
145
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
+
146
166
### Testing
147
167
148
168
To run the tests of this package with wasm, either download the ` sqlite3.wasm ` file from the
0 commit comments