Skip to content

Commit 687c633

Browse files
committed
Add web instructions for drift
1 parent f5609fa commit 687c633

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

packages/drift_sqlite_async/README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
`drift_sqlite_async` allows using drift on an sqlite_async database - the APIs from both can be seamlessly used together in the same application.
44

55
Supported functionality:
6+
67
1. All queries including select, insert, update, delete.
78
2. Transactions and nested transactions.
89
3. Table updates are propagated between sqlite_async and Drift - watching queries works using either API.
910
4. Select queries can run concurrently with writes and other select statements.
1011

11-
1212
## Usage
1313

1414
Use `SqliteAsyncDriftConnection` to create a DatabaseConnection / QueryExecutor for Drift from the sqlite_async SqliteDatabase:
@@ -59,4 +59,24 @@ These events are only sent while no write transaction is active.
5959

6060
Within Drift's transactions, Drift's own update notifications will still apply for watching queries within that transaction.
6161

62-
Note: There is a possibility of events being duplicated. This should not have a significant impact on most applications.
62+
Note: There is a possibility of events being duplicated. This should not have a significant impact on most applications.
63+
64+
## Web
65+
66+
Note: Web support is currently in Beta.
67+
68+
Web support requires Sqlite3 WASM and web worker Javascript files to be accessible. These file need to be put into the `web/` directory of your app.
69+
70+
The compiled web worker files can be found in our Github [releases](https://github.com/powersync-ja/sqlite_async.dart/releases)
71+
The `sqlite3.wasm` asset can be found [here](https://github.com/simolus3/sqlite3.dart/releases)
72+
73+
In the end your `web/` directory will look like the following
74+
75+
```
76+
web/
77+
├── favicon.png
78+
├── index.html
79+
├── manifest.json
80+
├── db_worker.js
81+
└── sqlite3.wasm
82+
```

0 commit comments

Comments
 (0)