Skip to content

Commit 3deeb14

Browse files
authored
Update sqlite3 to version 2.4.4 (#47)
* Bump sqlite3 version * Update to single database type * Update test dart sdk version * Revert to using CommonDatabase type * Use CommonDatabase type * Revert some changes Update to version 0.7.0 * Fix import * Change open DB to be synchronous * Update changelog * Fix changelog message * Fix linting errors
1 parent 34e3161 commit 3deeb14

File tree

8 files changed

+23
-19
lines changed

8 files changed

+23
-19
lines changed

.github/workflows/test.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ jobs:
3232
include:
3333
- sqlite_version: "3440200"
3434
sqlite_url: "https://www.sqlite.org/2023/sqlite-autoconf-3440200.tar.gz"
35-
dart_sdk: 3.3.3
35+
dart_sdk: 3.4.0
3636
- sqlite_version: "3430200"
3737
sqlite_url: "https://www.sqlite.org/2023/sqlite-autoconf-3430200.tar.gz"
38-
dart_sdk: 3.3.3
38+
dart_sdk: 3.4.0
3939
- sqlite_version: "3420000"
4040
sqlite_url: "https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz"
41-
dart_sdk: 3.3.3
41+
dart_sdk: 3.4.0
4242
- sqlite_version: "3410100"
4343
sqlite_url: "https://www.sqlite.org/2023/sqlite-autoconf-3410100.tar.gz"
44-
dart_sdk: 3.3.3
44+
dart_sdk: 3.4.0
4545
- sqlite_version: "3380000"
4646
sqlite_url: "https://www.sqlite.org/2022/sqlite-autoconf-3380000.tar.gz"
47-
dart_sdk: 3.3.3
47+
dart_sdk: 3.4.0
4848
steps:
4949
- uses: actions/checkout@v3
5050
- uses: dart-lang/setup-dart@v1

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.7.0
2+
3+
- BREAKING CHANGE: Update all Database types to use a `CommonDatabase` interface.
4+
- Update `openDB` and `open` methods to be synchronous.
5+
- Fix `ArgumentError (Invalid argument(s): argument value for 'return_value' is null)` in sqlite3 when closing the database connection by upgrading to version 2.4.4.
6+
17
## 0.6.1
28

39
- Fix errors when closing a `SqliteDatabase`.

example/custom_functions_example.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'dart:async';
21
import 'dart:io';
32
import 'dart:isolate';
43

@@ -11,8 +10,8 @@ class TestOpenFactory extends DefaultSqliteOpenFactory {
1110
TestOpenFactory({required super.path, super.sqliteOptions});
1211

1312
@override
14-
FutureOr<CommonDatabase> open(SqliteOpenOptions options) async {
15-
final db = await super.open(options);
13+
CommonDatabase open(SqliteOpenOptions options) {
14+
final db = super.open(options);
1615

1716
db.createFunction(
1817
functionName: 'sleep',

example/linux_cli_example.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'dart:async';
21
import 'dart:ffi';
32

43
import 'package:sqlite3/common.dart';
@@ -17,7 +16,7 @@ class TestOpenFactory extends DefaultSqliteOpenFactory {
1716
this.sqlitePath = defaultSqlitePath});
1817

1918
@override
20-
FutureOr<CommonDatabase> open(SqliteOpenOptions options) async {
19+
CommonDatabase open(SqliteOpenOptions options) {
2120
// For details, see:
2221
// https://pub.dev/packages/sqlite3#manually-providing-sqlite3-libraries
2322
sqlite_open.open.overrideFor(sqlite_open.OperatingSystem.linux, () {

lib/src/common/abstract_open_factory.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class SqliteOpenFactory<Database extends sqlite.CommonDatabase> {
1515
String get path;
1616

1717
/// Opens a direct connection to the SQLite database
18-
FutureOr<Database> open(SqliteOpenOptions options);
18+
Database open(SqliteOpenOptions options);
1919

2020
/// Opens an asynchronous [SqliteConnection]
2121
FutureOr<SqliteConnection> openConnection(SqliteOpenOptions options);
@@ -77,14 +77,14 @@ abstract class AbstractDefaultSqliteOpenFactory<
7777
@protected
7878

7979
/// Opens a direct connection to a SQLite database connection
80-
FutureOr<Database> openDB(SqliteOpenOptions options);
80+
Database openDB(SqliteOpenOptions options);
8181

8282
@override
8383

8484
/// Opens a direct connection to a SQLite database connection
8585
/// and executes setup pragma statements to initialize the DB
86-
FutureOr<Database> open(SqliteOpenOptions options) async {
87-
var db = await openDB(options);
86+
Database open(SqliteOpenOptions options) {
87+
var db = openDB(options);
8888

8989
// Pragma statements don't have the same BUSY_TIMEOUT behavior as normal statements.
9090
// We add a manual retry loop for those.

lib/src/native/database/native_sqlite_connection_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void _sqliteConnectionIsolate(_SqliteConnectionParams params) async {
264264
await client.post(const InitDb());
265265
}
266266

267-
final db = await params.openFactory.open(SqliteOpenOptions(
267+
final db = params.openFactory.open(SqliteOpenOptions(
268268
primaryConnection: params.primary, readOnly: params.readOnly));
269269

270270
runZonedGuarded(() async {

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: sqlite_async
22
description: High-performance asynchronous interface for SQLite on Dart and Flutter.
3-
version: 0.6.1
3+
version: 0.7.0
44
repository: https://github.com/powersync-ja/sqlite_async.dart
55
environment:
66
sdk: ">=3.2.0 <4.0.0"
77

88
dependencies:
9-
sqlite3: "^2.3.0"
9+
sqlite3: "^2.4.4"
1010
async: ^2.10.0
1111
collection: ^1.17.0
1212
meta: ^1.10.0

test/utils/native_test_utils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class TestSqliteOpenFactory extends TestDefaultSqliteOpenFactory {
2121
initStatements});
2222

2323
@override
24-
FutureOr<CommonDatabase> open(SqliteOpenOptions options) async {
24+
CommonDatabase open(SqliteOpenOptions options) {
2525
sqlite_open.open.overrideFor(sqlite_open.OperatingSystem.linux, () {
2626
return DynamicLibrary.open(sqlitePath);
2727
});
28-
final db = await super.open(options);
28+
final db = super.open(options);
2929

3030
db.createFunction(
3131
functionName: 'test_sleep',

0 commit comments

Comments
 (0)