Skip to content

Commit

Permalink
Merging from dart3a
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Dec 15, 2023
2 parents 061e190 + de74e4c commit d70c3fc
Show file tree
Hide file tree
Showing 33 changed files with 901 additions and 12 deletions.
7 changes: 7 additions & 0 deletions packages/sqflite_common_ffi_async/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
3 changes: 3 additions & 0 deletions packages/sqflite_common_ffi_async/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 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.
14 changes: 14 additions & 0 deletions packages/sqflite_common_ffi_async/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# sqflite ffi async

[sqflite](https://pub.dev/packages/sqflite) based ffi implementation. Based
on [`sqlite_async`](https://pub.dev/packages/sqlite_async). Thanks to [PowerSync](https://github.com/powersync-ja)

* 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))

## Caveats

This is a work in progress.
- Readonly support is provided by `sqflite_common_ffi`
- In memory support is provided by `sqflite_common_ffi`
30 changes: 30 additions & 0 deletions packages/sqflite_common_ffi_async/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
6 changes: 6 additions & 0 deletions packages/sqflite_common_ffi_async/lib/sqflite_ffi_async.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// sqflite on top of sqlite_async
library;

export 'src/platform.dart'
show databaseFactoryFfiAsync, databaseFactoryFfiAsyncTest;
export 'package:sqflite_common/sqflite.dart';
13 changes: 13 additions & 0 deletions packages/sqflite_common_ffi_async/lib/src/import.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// ignore_for_file: depend_on_referenced_packages

export 'package:sqflite_common/src/database.dart';
export 'package:sqflite_common/src/database_mixin.dart';
export 'package:sqflite_common/src/factory_mixin.dart';
export 'package:sqflite_common/src/exception.dart';
export 'package:sqflite_common/src/constant.dart';
export 'package:sqflite_common/src/transaction.dart';
export 'package:sqflite_common_ffi/src/mixin/handler_mixin.dart';
export 'package:sqflite_common/src/dev_utils.dart';
export 'package:sqflite_common/src/batch.dart';
export 'package:sqflite_common/src/cursor.dart';
export 'package:sqflite_common/src/sql_command.dart';
1 change: 1 addition & 0 deletions packages/sqflite_common_ffi_async/lib/src/platform.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'platform_io.dart' if (dart.library.js) 'platform_web.dart';
9 changes: 9 additions & 0 deletions packages/sqflite_common_ffi_async/lib/src/platform_io.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
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;
9 changes: 9 additions & 0 deletions packages/sqflite_common_ffi_async/lib/src/platform_web.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'package:sqflite_common_ffi/sqflite_ffi.dart';

/// The Ffi database factory.
DatabaseFactory get databaseFactoryFfiAsync => throw UnsupportedError(
'Unsupported on the web, use sqflite_common_ffi_web');

/// The Ffi database factory.
DatabaseFactory get databaseFactoryFfiAsyncTest => throw UnsupportedError(
'Unsupported on the web, use sqflite_common_ffi_web');
Loading

0 comments on commit d70c3fc

Please sign in to comment.