Skip to content

[sqflite] New Sqflite Tizen plugin #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
a2fb797
WIP
rmanganiello Oct 1, 2021
cb41c32
Remove unused folder
rmanganiello Oct 12, 2021
0d9340e
Rename test
rmanganiello Oct 12, 2021
88afbec
Add update/insert/query functionalities
rmanganiello Oct 12, 2021
b4caebb
Fix static variables and onDelete
rmanganiello Oct 12, 2021
04ab2ce
Start throwing exceptions in DatabaseManager
rmanganiello Oct 14, 2021
1fc3173
Make batch operations work
rmanganiello Oct 15, 2021
9ad1959
Fix batch call
rmanganiello Oct 15, 2021
a6a9467
Fix OnOpenDatabaseCall and open readOnly database
rmanganiello Oct 15, 2021
541c5af
RAII for db, support blobs/lists and simplify code
rmanganiello Nov 6, 2021
23f3b4f
Handle query exceptions correctly
rmanganiello Nov 6, 2021
088b01f
Handle empty resultset response while querying
rmanganiello Nov 6, 2021
b84a811
Fix no-rowid tests for tizen
rmanganiello Nov 6, 2021
f1358ad
Remove usages of deprecated `debugModeOn` in raw_test_page
rmanganiello Nov 6, 2021
ecf5ef2
Use correct error for open failed exception
rmanganiello Nov 6, 2021
5d3fd54
Add assets to test from asset db
rmanganiello Nov 6, 2021
77089b2
Fix more tests and change open sub folder test to fail
rmanganiello Nov 6, 2021
61d2537
Fix exp tests
rmanganiello Nov 7, 2021
3c08869
Simplify code
rmanganiello Nov 7, 2021
d761a31
Create constants
rmanganiello Nov 7, 2021
abef09d
Fix manual tests and add OnDebugCall support
rmanganiello Nov 7, 2021
9f08de7
Check for allowed permissions properly
rmanganiello Nov 15, 2021
7ed331d
Remove `using`
rmanganiello Nov 15, 2021
317c56a
Apply `expect` implementation fix from sqflite
rmanganiello Nov 15, 2021
ce6a1d3
Update README
rmanganiello Nov 15, 2021
f22143c
Update README
rmanganiello Nov 15, 2021
5709a52
Update README.md
rmanganiello Nov 15, 2021
0a477c4
Remove unneded tests
rmanganiello Nov 15, 2021
3b70b39
Remove unneded example project dependencies
rmanganiello Nov 15, 2021
9566b5b
Remove test_driver folder
rmanganiello Nov 15, 2021
75de0ec
Remove unneded files and variables
rmanganiello Nov 15, 2021
f473d9d
Add new line EOF
rmanganiello Nov 15, 2021
5d3b0dd
Fix manifest and remove useless folder
rmanganiello Nov 15, 2021
0cc91d3
Add new lines at EOF
rmanganiello Nov 15, 2021
2ea32b4
Add new line at EOF
rmanganiello Nov 15, 2021
3b3b48e
Cleanup code
rmanganiello Nov 15, 2021
3baf88d
Use constant
rmanganiello Nov 15, 2021
6ba2271
Add SQFlite LICENSE for example project
rmanganiello Nov 15, 2021
a9af1ff
Move to MINOR version
rmanganiello Nov 15, 2021
90843b8
Add integration tests
rmanganiello Nov 15, 2021
1adf4e5
Fix Dart issues
rmanganiello Nov 17, 2021
2c55904
Add sqflite to recipe.yaml for integration tests
rmanganiello Nov 17, 2021
1fe82f8
Remove permission check for mediastorage
rmanganiello Nov 19, 2021
dad2b58
Set sqlite3_busy_timeout and add tv target
rmanganiello Nov 19, 2021
47dae39
Apply Style guide
rmanganiello Nov 23, 2021
0f44c4e
Convert to snake_case
rmanganiello Nov 23, 2021
d47bec4
Move static members to end of class
rmanganiello Nov 23, 2021
c8ec922
Remove unneded methods
rmanganiello Nov 23, 2021
fbab1f8
Remove deprecated constant and move struct out of class
rmanganiello Nov 23, 2021
044c8e3
Apply more style guide rules
rmanganiello Nov 23, 2021
b2ab06b
Remove logs, fix licenses and apply suggested comments
rmanganiello Nov 26, 2021
17435e6
Add log_level support and style guide changes
rmanganiello Nov 28, 2021
de62d02
Fix variables naming database manager header
rmanganiello Nov 28, 2021
14f755a
Fix database_manager header private variables order
rmanganiello Nov 28, 2021
ef64494
Remove unused imports
rmanganiello Dec 2, 2021
05d2125
Include `mutex` support and fix DatabaseManager
rmanganiello Dec 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**sensors_plus_tizen**](packages/sensors_plus) | [sensors_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/sensors_plus) (1st-party) | [![pub package](https://img.shields.io/pub/v/sensors_plus_tizen.svg)](https://pub.dev/packages/sensors_plus_tizen) | No |
| [**share_plus_tizen**](packages/share_plus) | [share_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus) (1st-party) | [![pub package](https://img.shields.io/pub/v/share_plus_tizen.svg)](https://pub.dev/packages/share_plus_tizen) | No |
| [**shared_preferences_tizen**](packages/shared_preferences) | [shared_preferences](https://github.com/flutter/plugins/tree/master/packages/shared_preferences) (1st-party) | [![pub package](https://img.shields.io/pub/v/shared_preferences_tizen.svg)](https://pub.dev/packages/shared_preferences_tizen) | No |
| [**sqflite_tizen**](packages/sqflite) | [sqflite](https://github.com/tekartik/sqflite) (3rd-party) | [![pub package](https://img.shields.io/pub/v/sqflite_tizen.svg)](https://pub.dev/packages/sqflite_tizen) | No |
| [**tizen_app_control**](packages/tizen_app_control) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_app_control.svg)](https://pub.dev/packages/tizen_app_control) | N/A |
| [**url_launcher_tizen**](packages/url_launcher) | [url_launcher](https://github.com/flutter/plugins/tree/master/packages/url_launcher) (1st-party) | [![pub package](https://img.shields.io/pub/v/url_launcher_tizen.svg)](https://pub.dev/packages/url_launcher_tizen) | No |
| [**video_player_tizen**](packages/video_player) | [video_player](https://github.com/flutter/plugins/tree/master/packages/video_player) (1st-party) | [![pub package](https://img.shields.io/pub/v/video_player_tizen.svg)](https://pub.dev/packages/video_player_tizen) | No |
Expand Down Expand Up @@ -75,6 +76,7 @@ The following packages are deprecated.
| [**sensors_plus_tizen**](packages/sensors_plus) | ✔️ | ✔️ | ❌ | ❌ | No sensor hardware |
| [**share_plus_tizen**](packages/share_plus) | ⚠️ | ⚠️ | ❌ | ❌ | No SMS or e-mail app |
| [**shared_preferences_tizen**](packages/shared_preferences) | ✔️ | ✔️ | ✔️ | ✔️ |
| [**sqflite_tizen**](packages/sqflite) | ✔️ | ✔️ | ✔️ ️| ✔️ |
| [**tizen_app_control**](packages/tizen_app_control) | ✔️ | ✔️ | ✔️ | ✔️ |
| [**url_launcher_tizen**](packages/url_launcher) | ✔️ | ❌ | ✔️ | ❌ | No browser app |
| [**video_player_tizen**](packages/video_player) | ✔️ | ✔️ | ⚠️ | ❌ | Functional limitations (see README)<br>TV emulator issue |
Expand Down
7 changes: 7 additions & 0 deletions packages/sqflite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
.dart_tool/

.packages
.pub/

build/
3 changes: 3 additions & 0 deletions packages/sqflite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

* Initial release.
27 changes: 27 additions & 0 deletions packages/sqflite/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BSD 2-Clause License

Copyright (c) 2021, Samsung Electronics Co., Ltd.
Copyright (c) 2021, Renzo Manganiello
Copyright (c) 2019, 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.
21 changes: 21 additions & 0 deletions packages/sqflite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# sqflite_tizen

The Tizen implementation of [`sqflite`](https://github.com/tekartik/sqflite).

## Getting Started

This package is not an _endorsed_ implementation of `sqflite`. Therefore, you have to include `sqflite_tizen` alongside `sqflite` as dependencies in your `pubspec.yaml` file.

```yaml
dependencies:
sqflite: ^2.0.1
sqflite_tizen: ^0.1.0
```

Then you can import `sqflite` in your Dart code:

```dart
import 'package:sqflite/sqflite.dart';
```

For more details, see [here](https://github.com/tekartik/sqflite/blob/master/sqflite/README.md).
103 changes: 103 additions & 0 deletions packages/sqflite/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
include: package:flutter_lints/flutter.yaml

# Until there are meta linter rules, each desired lint must be explicitly enabled.
# See: https://github.com/dart-lang/linter/issues/288
#
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
# See the configuration guide for more
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
#
# NOTE: Please keep this file in sync with
# https://github.com/flutter/flutter/blob/master/analysis_options.yaml

analyzer:
# Strong mode is sometimes harder to keep
strong-mode:
implicit-casts: false

errors:
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning
# treat missing returns as a warning (not a hint)
missing_return: warning
# allow having TODOs in the code
todo: ignore
# Ignore errors like
# 'super_goes_last' is a deprecated lint rule and should not be used • included_file_warning
included_file_warning: ignore

linter:
rules:
- always_declare_return_types
- avoid_dynamic_calls
- avoid_empty_else
- avoid_relative_lib_imports
- avoid_shadowing_type_parameters
- avoid_slow_async_io
- avoid_types_as_parameter_names
- await_only_futures
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- hash_and_equals
- iterable_contains_unrelated_type
- list_remove_unrelated_type
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
- omit_local_variable_types
- package_api_docs
- package_prefixed_library_names
- prefer_generic_function_type_aliases
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- sort_child_properties_last
- test_types_in_equals
- throw_in_finally
- unawaited_futures
- unnecessary_null_aware_assignments
- unnecessary_statements
- unrelated_type_equality_checks
- unsafe_html
- valid_regexps

- constant_identifier_names
- control_flow_in_finally
- empty_statements
- implementation_imports
- overridden_fields
- package_names
- prefer_const_constructors
- prefer_initializing_formals
- prefer_void_to_null
#
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_return_types_on_setters
- empty_constructor_bodies
- library_names
- library_prefixes
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_contains
- prefer_equal_for_default_values
- slash_for_doc_comments
- type_init_formals
- unnecessary_const
- unnecessary_new
- unnecessary_null_in_if_null_operators
- use_rethrow_when_possible
# === doc rules ===
- public_member_api_docs
#
- prefer_final_locals
- sort_constructors_first
- sort_unnamed_constructors_first
46 changes: 46 additions & 0 deletions packages/sqflite/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
25 changes: 25 additions & 0 deletions packages/sqflite/example/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2019, 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.
7 changes: 7 additions & 0 deletions packages/sqflite/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# sqflite_tizen_example

Demonstrates how to use the sqflite_tizen plugin.

## Getting Started

To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).
Binary file added packages/sqflite/example/assets/example.db
Binary file not shown.
Binary file added packages/sqflite/example/assets/issue_64.db
Binary file not shown.
Loading