Skip to content

Commit

Permalink
[sqflite_common_ffi_async] v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Dec 15, 2023
1 parent 22ead77 commit de74e4c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/sqflite_common_ffi_async/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 1.0.0
## 0.1.0

- Initial version.
25 changes: 25 additions & 0 deletions packages/sqflite_common_ffi_async/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2019, Alexandre Roux Tekartik
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8 changes: 7 additions & 1 deletion packages/sqflite_common_ffi_async/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ on [`sqlite_async`](https://pub.dev/packages/sqlite_async). Thanks to [PowerSync

* Works on Linux, MacOS and Windows on both Flutter and Dart VM.
* Works on iOS and Android (using [sqlite3_flutter_libs](https://pub.dev/packages/sqlite3_flutter_libs) - Thanks
to [Simon Binder](https://github.com/simolus3))
to [Simon Binder](https://github.com/simolus3))

## Caveats

This is a work in progress.
- Readonly support is provided by `sqflite_common_ffi`
- In memory support is provided by `sqflite_common_ffi`
4 changes: 1 addition & 3 deletions packages/sqflite_common_ffi_async/lib/sqflite_ffi_async.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/// Support for doing something awesome.
///
/// More dartdocs go here.
/// sqflite on top of sqlite_async
library;

export 'src/platform.dart'
Expand Down
2 changes: 2 additions & 0 deletions packages/sqflite_common_ffi_async/lib/src/platform_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ import 'package:sqflite_common_ffi_async/src/sqflite_ffi_async_factory.dart';

/// The Ffi database factory.
DatabaseFactory get databaseFactoryFfiAsync => databaseFactoryFfiAsyncImpl;

/// The Ffi database factory for tests.
DatabaseFactory get databaseFactoryFfiAsyncTest =>
databaseFactoryFfiAsyncTestImpl;
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ class SqfliteDatabaseFactoryFfiAsync with SqfliteDatabaseFactoryMixin {
if (options?.readOnly ?? false) {
return factoryFfi.openDatabase(path, options: options);
}
// Use ffi for in memory (since it is mainly for tests...)
if (path == inMemoryDatabasePath) {
return factoryFfi.openDatabase(path, options: options);
}
return super.openDatabase(path, options: options);
}
}
5 changes: 2 additions & 3 deletions packages/sqflite_common_ffi_async/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: sqflite_common_ffi_async
homepage: https://github.com/tekartik/sqflite/tree/master/packages/sqflite_common_ffi_async
description: Sqlite API on top on sqlite_async
version: 1.0.0
publish_to: none
# repository: https://github.com/my_org/my_repo
version: 0.1.0

environment:
sdk: ^3.2.0
Expand Down

0 comments on commit de74e4c

Please sign in to comment.