Skip to content

Can we fix some SQLCipher for build flags? #298

@brody2consult

Description

@brody2consult

There seem to be some irrelevant and duplicate SQLCIPHER_CFLAGS defined in the Makefile:

  • SQLITE_THREADSAFE - appears twice (first time with correct [default] value, second time with no value specified)
  • SQLITE_ENABLE_MEMORY_MANAGEMENT - appears twice
  • SQLITE_ENABLE_FTS3_BACKWARDS - does not appear in https://www.sqlite.org/compile.html or sqlcipher source
  • SQLITE_ENABLE_LOAD_EXTENSION - Is there any way a SQLCipher user would actually load binary extensions on Android?
  • SQLITE_ENABLE_COLUMN_METADATA - from https://www.sqlite.org/compile.html the following functions do not seem to be used here: sqlite3_column_database_name(), sqlite3_column_database_name16(), sqlite3_column_table_name(), sqlite3_column_table_name16(), sqlite3_column_origin_name(), or sqlite3_column_origin_name16()
  • SQLITE_ENABLE_UNLOCK_NOTIFY - sqlite3_unlock_notify() not used here
  • SQLITE_ENABLE_FTS4_UNICODE61 - I did not find it in https://www.sqlite.org/compile.html or SQLCipher source
  • NDEBUG - not documented in https://www.sqlite.org/compile.html. Looking through the generated amalgamation it seems from one of the headers that NDEBUG will be automatically defined or undefined opposite toSQLITE_DEBUG.

Also: looking at https://www.sqlite.org/compile.html#recommended_compile_time_options I was wondering if the following items should be defined:

  • SQLITE_OMIT_DECLTYPE (sqlite3_column_decltype() and sqlite3_column_decltype16() do not seem to be used here)
  • SQLITE_OMIT_DEPRECATED - none of the reference functions (sqlite3_aggregate_count(), sqlite3_expired(), sqlite3_transfer_bindings(), sqlite3_global_recover(), sqlite3_thread_cleanup(), or sqlite3_memory_alarm()) seem to be used here
  • SQLITE_OMIT_PROGRESS_CALLBACK (sqlite3_progress_handler() does not seem to be used here)
  • SQLITE_OMIT_SHARED_CACHE (sqlite3_enable_shared_cache() does not seem to be used here)

In general I would like to get these build settings consistent for Android, iOS, and Windows in my Cordova plugin and would like to avoid maintaining a custom Android build if possible. Thanks for your consideration.

P.S. I would be happy to raise a pull request if desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions