Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- doc updates
- sqlite 3.22.0
- build flag updates

Includes SQLITE_DEFAULT_SYNCHRONOUS=3 (EXTRA DURABLE build setting)
ref: storesafe/cordova-sqlite-storage#736
  • Loading branch information
Christopher J. Brody committed Mar 26, 2018
2 parents 70b3449 + df449f9 commit 1c22d06
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ regen:
ndkbuild:
rm -rf lib libs *.jar
ndk-build
# XXX
# zip ...
# mv libs lib
cp -r libs lib
jar cf evcore-native-driver.jar lib

Expand Down
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,34 @@ Android-sqlite-evcore-native-driver-free provides:

This is accomplished by using [GlueGen](http://jogamp.org/gluegen/www/) around the C module.

**NOTE:** This project references multiple subprojects, which can resolved by: $ `make init` (as described below).
**NOTE:** This project references multiple subprojects, which may be resolved by: $ `make init` (as described below).

**WARNING:** The reference handles that are returned by the `EVCoreNativeDriver` library functions are raw C pointer values (with `0x100000000` added). If someone uses a reference handle that is not valid, or no longer valid with the `EVCoreNativeDriver` library the behavior is undefined (may crash, for example). It is NOT recommended to use this API directly unless you really understand how this library works internally.

FUTURE TODO: better documentation of API and some internal details

## SQLite build information

### SQLite version

`3.15.2`

### SQLite build flags:
3.22.0

General:
### SQLite build flags

- `-DSQLITE_THREADSAFE=1`
- `-DSQLITE_DEFAULT_SYNCHRONOUS=3`
- `-DSQLITE_DEFAULT_MEMSTATUS=0`
- `-DSQLITE_OMIT_DECLTYPE`
- `-DSQLITE_OMIT_DEPRECATED`
- `-DSQLITE_OMIT_PROGRESS_CALLBACK`
- `-DSQLITE_OMIT_SHARED_CACHE`
- `-DSQLITE_TEMP_STORE=2`
- `-DSQLITE_THREADSAFE=2`
- `-DSQLITE_OMIT_LOAD_EXTENSION`
- `-DSQLITE_ENABLE_FTS3`
- `-DSQLITE_ENABLE_FTS3_PARENTHESIS`
- `-DSQLITE_ENABLE_FTS4`
- `-DSQLITE_ENABLE_RTREE`
- `-DSQLITE_ENABLE_FTS5`
- `-DSQLITE_ENABLE_RTREE`
- `-DSQLITE_ENABLE_JSON1`

Explicit default page/cache sizes (newer default values) as described at <http://sqlite.org/pgszchng2016.html>:
Expand All @@ -57,6 +64,12 @@ Explicit default page/cache sizes (newer default values) as described at <http:/

- Support direct query of BLOB type

__FUTURE TBD/TODO:__

- Automatic AAR build
- Document this project (again, perhaps in a blog post)
- Some more SQLite API functions will be needed to rebuild the native sqlcipher library to replace the native libraries in the [@sqlcipher / android-database-sqlcipher](https://github.com/sqlcipher/android-database-sqlcipher) ([SQLCipher for Android](https://www.zetetic.net/sqlcipher/sqlcipher-for-android/)) project.

# Building

## Normal build
Expand Down
15 changes: 12 additions & 3 deletions jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/../sqlite3-regexp-cached
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libb64-encode
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../sqlite3-base64

LOCAL_CFLAGS += -DSQLITE_TEMP_STORE=2 -DSQLITE_THREADSAFE=2
LOCAL_CFLAGS += -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE

LOCAL_CFLAGS += -DSQLITE_THREADSAFE=1
LOCAL_CFLAGS += -DSQLITE_DEFAULT_SYNCHRONOUS=3
LOCAL_CFLAGS += -DSQLITE_DEFAULT_MEMSTATUS=0
LOCAL_CFLAGS += -DSQLITE_OMIT_DECLTYPE
LOCAL_CFLAGS += -DSQLITE_OMIT_DEPRECATED
LOCAL_CFLAGS += -DSQLITE_OMIT_PROGRESS_CALLBACK
LOCAL_CFLAGS += -DSQLITE_OMIT_SHARED_CACHE
LOCAL_CFLAGS += -DSQLITE_TEMP_STORE=2
LOCAL_CFLAGS += -DSQLITE_OMIT_LOAD_EXTENSION
LOCAL_CFLAGS += -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
LOCAL_CFLAGS += -DSQLITE_ENABLE_FTS4
LOCAL_CFLAGS += -DSQLITE_ENABLE_FTS5
LOCAL_CFLAGS += -DSQLITE_ENABLE_RTREE
LOCAL_CFLAGS += -DSQLITE_ENABLE_JSON1

# explicit default page/cache sizes (new defaults):
Expand Down
2 changes: 1 addition & 1 deletion sqlite-amalgamation
Submodule sqlite-amalgamation updated 4 files
+1 −1 README.md
+17,880 −9,792 sqlite3.c
+703 −247 sqlite3.h
+30 −5 sqlite3ext.h

0 comments on commit 1c22d06

Please sign in to comment.