Skip to content

Conversation

@groue
Copy link
Owner

@groue groue commented Sep 28, 2025

This pull request aims at easing the job of #1708 and #1816, by checking the SQLITE_HAS_CODEC compiler flag for enabling SQLCipher features.

The GRDBCIPHER compiler flag is now only used for detecting the SQLCipher CocoaPods:

#if GRDBCIPHER // CocoaPods (SQLCipher subspec)
import SQLCipher
#else ...
#endif

#if SQLITE_HAS_CODEC
// GRDB is linked against some flavor of SQLCipher:
// sqlite3_key, PRAGMA cipher_version, etc. are available
#endif

@marcprux, @R4N, I'll merge if you both agree that this pull request is actually useful.

@groue
Copy link
Owner Author

groue commented Sep 28, 2025

Also, @marcprux, I believe this new interpretation of compiler flags removes the need to rework the order of imports, as in b26c42c. Am I correct?

@R4N
Copy link

R4N commented Sep 29, 2025

@groue This looks good to us as well. I believe we'll still need to adjust the order so that the SQLCIPHER/SKIP_SQLCIPHER import checks are prior to SWIFT_PACKAGE import check in our PR's since SWIFT_PACKAGE will be true for both:

// Import C SQLite functions
#if SQLCIPHER
import SQLCipher
// #elseif SKIP_SQLCIPHER
// import for SKIP_SQLCIPHER
#elseif SWIFT_PACKAGE
import GRDBSQLite
#elseif GRDBCIPHER
import SQLCipher
#elseif !GRDBCUSTOMSQLITE && !SQLITE_HAS_CODEC
import SQLite3
#endif

we'll sync up our fork once this is merged in and base our PR off of it.

groue added 2 commits October 12, 2025 14:49
… availability

GRDBCIPHER is now just a marker for importing SQLCipher with CocoaPods.

Also, enable all APIs that used to be disabled with SQLCipher, and skip tests that require a specific SQLite version.
@groue groue force-pushed the dev/SQLCipher-cleanup branch from 35d6fbc to c35095c Compare October 12, 2025 13:19
@groue
Copy link
Owner Author

groue commented Oct 12, 2025

The import section was refactored in #1826. This pull request has been rebased on top of it, and does no longer modify the imports.

@groue groue merged commit a60810f into development Oct 12, 2025
8 checks passed
@groue groue deleted the dev/SQLCipher-cleanup branch October 12, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants