Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit daf9331

Browse files
committedJul 4, 2024
cleanup
1 parent c40bcda commit daf9331

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed
 

‎.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Check publish score
2424
run: |
2525
dart pub global activate pana
26-
dart pub global run pana --no-warning --exit-code-threshold 10
26+
dart pub global run pana --no-warning --exit-code-threshold 0
2727
2828
test:
2929
runs-on: ubuntu-latest

‎README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sqlite_async
1+
# sqlite_async
22

33
High-performance asynchronous interface for SQLite on Dart & Flutter.
44

@@ -15,13 +15,13 @@ query access.
1515

1616
## Features
1717

18-
* All operations are asynchronous by default - does not block the main isolate.
19-
* Watch a query to automatically re-run on changes to the underlying data.
20-
* Concurrent transactions supported by default - one write transaction and many multiple read transactions.
21-
* Uses WAL mode for fast writes and running read transactions concurrently with a write transaction.
22-
* Direct synchronous access in an isolate is supported for performance-sensitive use cases.
23-
* Automatically convert query args to JSON where applicable, making JSON1 operations simple.
24-
* Direct SQL queries - no wrapper classes or code generation required.
18+
- All operations are asynchronous by default - does not block the main isolate.
19+
- Watch a query to automatically re-run on changes to the underlying data.
20+
- Concurrent transactions supported by default - one write transaction and many multiple read transactions.
21+
- Uses WAL mode for fast writes and running read transactions concurrently with a write transaction.
22+
- Direct synchronous access in an isolate is supported for performance-sensitive use cases.
23+
- Automatically convert query args to JSON where applicable, making JSON1 operations simple.
24+
- Direct SQL queries - no wrapper classes or code generation required.
2525

2626
See this [blog post](https://www.powersync.co/blog/sqlite-optimizations-for-ultra-high-performance),
2727
explaining why these features are important for using SQLite.
@@ -78,18 +78,16 @@ void main() async {
7878

7979
# Web
8080

81-
Web support is provided by the [Drift](https://github.com/powersync-ja/drift/pull/1) library. Detailed instructions for compatibility and setup are listed in the link.
82-
83-
Web support requires Sqlite3 WASM and Drift worker Javascript files to be accessible via configurable URIs.
81+
Web support requires Sqlite3 WASM and web worker Javascript files to be accessible via configurable URIs.
8482

8583
Default URIs are shown in the example below. URIs only need to be specified if they differ from default values.
8684

87-
Watched queries and table change notifications are only supported when using a custom Drift worker which is compiled by linking
88-
https://github.com/powersync-ja/drift/pull/1.
85+
The compiled web worker files can be found in our Github [releases](https://github.com/powersync-ja/sqlite_async.dart/releases)
86+
The `sqlite3.wasm` asset can be found [here](https://github.com/simolus3/sqlite3.dart/releases)
8987

9088
Setup
9189

92-
``` Dart
90+
```Dart
9391
import 'package:sqlite_async/sqlite_async.dart';
9492
9593
final db = SqliteDatabase(
@@ -99,4 +97,3 @@ final db = SqliteDatabase(
9997
wasmUri: 'sqlite3.wasm', workerUri: 'db_worker.js')));
10098
10199
```
102-

‎lib/src/web/web_mutex.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:mutex/mutex.dart' as mutex;
22
import 'package:sqlite_async/src/common/mutex.dart';
33

44
/// Web implementation of [Mutex]
5-
/// This will use `navigator.locks` in future
5+
/// This should use `navigator.locks` in future
66
class MutexImpl implements Mutex {
77
late final mutex.Mutex m;
88

@@ -12,12 +12,12 @@ class MutexImpl implements Mutex {
1212

1313
@override
1414
Future<void> close() async {
15-
// TODO
15+
// This isn't relevant for web at the moment.
1616
}
1717

1818
@override
1919
Future<T> lock<T>(Future<T> Function() callback, {Duration? timeout}) {
20-
// TODO: use web navigator locks here
20+
// Note this lock is only valid in a single web tab
2121
return m.protect(callback);
2222
}
2323

0 commit comments

Comments
 (0)
Please sign in to comment.