Skip to content

Commit d412eb5

Browse files
author
Christopher J. Brody
committed
cordova-sqlite-express-wip 1.0.0-pretest01
1 parent 8192bc8 commit d412eb5

File tree

6 files changed

+26
-51
lines changed

6 files changed

+26
-51
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
# cordova-sqlite-express-wip 1.0.0-pretest01
4+
5+
New version branch WIP using builtin sqlite library on Android/iOS/macOS, no external sqlite3 dependencies
6+
37
## cordova-sqlite-storage 2.1.4-fixdev01
48

59
- android.database end transaction if active before closing

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
# Cordova/PhoneGap sqlite storage plugin
1+
# Cordova/PhoneGap sqlite storage express WIP
22

3-
Native interface to sqlite in a Cordova/PhoneGap plugin for Android, iOS, macOS, and Windows 10 (UWP), with API similar to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/).
3+
Native interface to sqlite in a Cordova/PhoneGap plugin for Android, iOS, macOS, ~~and Windows 10 (UWP)~~, with API similar to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/).
44

55
License terms for Android and Windows platform versions: MIT or Apache 2.0
66

77
License terms for iOS/macOS platform version: MIT only
88

99
## About this version branch
1010

11-
This is the common version branch which supports the most widely used features and serves as the basis for the other versions.
11+
EXPERIMENTAL "express" version with builtin sqlite3 libraries for Android/iOS/macOS, no Windows version support
1212

13-
This version branch uses a `before_plugin_install` hook to install sqlite3 library dependencies from `cordova-sqlite-storage-dependencies` via npm.
13+
XXX TODO:
14+
- update tests for actual behavior of builtin android.database implementation
15+
- update this documentation
16+
- update description in package.json & plugin.xml
1417

18+
<!-- XXX GONE:
1519
|Android Circle-CI (**full** suite)|iOS Travis-CI (partial suite)|
1620
|-----------------------|----------------------|
1721
|[![Circle CI](https://circleci.com/gh/litehelpers/Cordova-sqlite-storage.svg?style=svg)](https://circleci.com/gh/litehelpers/Cordova-sqlite-storage)|[![Build Status](https://travis-ci.org/litehelpers/Cordova-sqlite-storage.svg)](https://travis-ci.org/litehelpers/Cordova-sqlite-storage)|
22+
-->
1823

1924
<!-- FUTURE TBD critial bug notices for this version branch -->
2025

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "cordova-sqlite-storage",
3-
"version": "2.1.4-fixdev01",
2+
"name": "cordova-sqlite-express-wip",
3+
"version": "1.0.0-pretest01",
44
"description": "Native interface to SQLite for PhoneGap/Cordova",
55
"cordova": {
6-
"id": "cordova-sqlite-storage",
6+
"id": "cordova-sqlite-express-wip",
77
"platforms": [
88
"android",
99
"ios",

plugin.xml

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
33
xmlns:android="http://schemas.android.com/apk/res/android"
4-
id="cordova-sqlite-storage"
5-
version="2.1.4-fixdev01">
4+
id="cordova-sqlite-express-wip"
5+
version="1.0.0-pretest01">
66

77
<name>Cordova sqlite storage plugin</name>
88

@@ -13,9 +13,6 @@
1313
<description>Native interface to SQLite for PhoneGap/Cordova. Allows you to use more storage and provides more flexibility than the standard Web SQL database (window.openDatabase).</description>
1414
<author>Litehelpers/Various</author>
1515

16-
<!-- THANKS to AllJoyn-Cordova / cordova-plugin-alljoyn: -->
17-
<hook type="before_plugin_install" src="scripts/beforePluginInstall.js" />
18-
1916
<js-module src="www/SQLitePlugin.js" name="SQLitePlugin">
2017
<clobbers target="SQLitePlugin" />
2118
</js-module>
@@ -31,16 +28,7 @@
3128

3229
<source-file src="src/android/io/sqlc/SQLitePlugin.java" target-dir="src/io/sqlc"/>
3330
<source-file src="src/android/io/sqlc/SQLiteAndroidDatabase.java" target-dir="src/io/sqlc"/>
34-
<source-file src="src/android/io/sqlc/SQLiteConnectorDatabase.java" target-dir="src/io/sqlc"/>
35-
36-
<!-- Android-sqlite-connector [jar]: -->
37-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/sqlite-connector.jar" target-dir="libs"/>
38-
<!-- Android-sqlite-connector native driver [native libs]: -->
39-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/arm64-v8a/libsqlc-native-driver.so" target-dir="libs/arm64-v8a"/>
40-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/armeabi/libsqlc-native-driver.so" target-dir="libs/armeabi"/>
41-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/armeabi-v7a/libsqlc-native-driver.so" target-dir="libs/armeabi-v7a"/>
42-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/x86/libsqlc-native-driver.so" target-dir="libs/x86"/>
43-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/x86_64/libsqlc-native-driver.so" target-dir="libs/x86_64"/>
31+
4432
</platform>
4533

4634
<!-- iOS -->
@@ -59,9 +47,7 @@
5947
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m"
6048
compiler-flags="-w" />
6149

62-
<header-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.h" />
63-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.c"
64-
compiler-flags="-w -DSQLITE_THREADSAFE=2 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_TEMP_STORE=2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_CACHE_SIZE=2000" />
50+
<framework src="libsqlite3.dylib" />
6551
</platform>
6652

6753
<!-- macOS (osx) -->
@@ -80,28 +66,7 @@
8066
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m"
8167
compiler-flags="-w" />
8268

83-
<header-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.h" />
84-
<source-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.c"
85-
compiler-flags="-w -DSQLITE_THREADSAFE=2 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_TEMP_STORE=2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_DEFAULT_PAGE_SIZE=1024" />
86-
</platform>
87-
88-
<!-- windows -->
89-
<platform name="windows">
90-
<js-module src="src/windows/sqlite-proxy.js" name="SQLiteProxy">
91-
<runs />
92-
</js-module>
93-
94-
<!-- SQLite3 JS module from SQLite3-WinRT/SQLite3JS: -->
95-
<js-module src="src/windows/SQLite3-Win-RT/SQLite3JS/js/SQLite3.js" name="SQLite3">
96-
<runs />
97-
</js-module>
98-
99-
<!-- Thanks to AllJoyn-Cordova / cordova-plugin-alljoyn for guidance: -->
100-
<framework src="src/windows/SQLite3-Win-RT/SQLite3/SQLite3.UWP/SQLite3.UWP.vcxproj" custom="true" type="projectReference" versions="10.*" />
101-
<!-- Windows 8.1 / Windows Phone 8.1 not tested, not supported in this version branch:
102-
<framework src="src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Windows/SQLite3.Windows.vcxproj" custom="true" type="projectReference" target="windows" versions="8.1" />
103-
<framework src="src/windows/SQLite3-Win-RT/SQLite3/SQLite3.WindowsPhone/SQLite3.WindowsPhone.vcxproj" custom="true" type="projectReference" target="phone" versions="8.1" />
104-
-->
69+
<framework src="libsqlite3.dylib" />
10570
</platform>
10671

10772
</plugin>

spec/www/spec/sqlite-version-test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var mytests = function() {
5050

5151
describe(suiteName + 'basic sqlite version test(s)', function() {
5252

53-
it(suiteName + 'Check sqlite version (pattern ONLY for WebKit Web SQL & androidDatabaseImplementation: 2)', function(done) {
53+
it(suiteName + 'Check sqlite version (pattern ONLY IN THIS VERSION BRANCH)', function(done) {
5454
var db = openDatabase("check-sqlite-version.db", "1.0", "Demo", DEFAULT_SIZE);
5555

5656
expect(db).toBeDefined();
@@ -64,9 +64,10 @@ var mytests = function() {
6464
expect(rs.rows.length).toBe(1);
6565
// Check pattern (both Web SQL & plugin)
6666
expect(rs.rows.item(0).myResult).toMatch(/3\.[0-9]+\.[0-9]+/);
67+
// XXX GONE IN THIS VERSION BRANCH:
6768
// Check specific [plugin only]:
68-
if (!isWebSql && !(!isWindows && isAndroid && isImpl2))
69-
expect(rs.rows.item(0).myResult).toBe('3.15.2');
69+
//* if (!isWebSql && !(!isWindows && isAndroid && isImpl2))
70+
//* expect(rs.rows.item(0).myResult).toBe('3.15.2');
7071

7172
// Close (plugin only) & finish:
7273
(isWebSql) ? done() : db.close(done, done);

src/android/io/sqlc/SQLitePlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private SQLiteAndroidDatabase openDatabase(String dbname, CallbackContext cbc, b
216216

217217
Log.v("info", "Open sqlite db: " + dbfile.getAbsolutePath());
218218

219-
SQLiteAndroidDatabase mydb = old_impl ? new SQLiteAndroidDatabase() : new SQLiteConnectorDatabase();
219+
SQLiteAndroidDatabase mydb = new SQLiteAndroidDatabase();
220220
mydb.open(dbfile);
221221

222222
if (cbc != null) // XXX Android locking/closing BUG workaround

0 commit comments

Comments
 (0)