Commit Graph
2207 Commits
Author SHA1 Message Date
Gwendal Roué 6f64c72209 Merge pull request #1879 from nesevis/fix/rowid-and-single-integer-primary-key
Fix upsert for WITHOUT ROWID tables with an INTEGER primary key
2026-09-27 09:12:49 +02:00
Gwendal Roué de0ce29d73 Encode strings with a NUL character
Inspired from #1880 by @nesevis
2026-09-26 16:34:14 +02:00
Gwendal Roué 9858de3249 Decode strings with a NUL character
Inspired from #1880 by @nesevis
2026-09-26 16:34:14 +02:00
Gwendal Roué 9f2e3b7d6b Optimize statement authorizer region accumulation
This commit is inspired by #1873 from @guidedways, who detected an unexpectedly quadratic behavior in the way we build database regions from the statement authorizer
2026-09-23 14:16:22 +02:00
Chris Kolbu 8511cfd399 Document INTEGER PRIMARY KEY in WITHOUT ROWID tables 2026-08-18 19:55:41 +10:00
Chris Kolbu 4373b3a49b Fix failing tests for INTEGER PRIMARY KEY in WITHOUT ROWID tables 2026-08-18 19:55:41 +10:00
latent-9 0a9a55d15f Fix doubled word in doc comment 2026-08-08 15:07:24 +12:00
Gwendal Roué fe3b957e5f Add missing Foundation imports 2026-06-10 12:55:39 +02:00
Gwendal Roué 27c7bda0e9 Refactor with DatabaseEventObservationStrategy
The issue with `observesAllDatabaseChanges` is that this was a misleading name: transaction observers are not notified of changes that are performed in a save point that is eventually rollbacked.

By exposing the DatabaseEventObservationStrategy type, we allow for a future extra flag that ignores save points, trading observation precision for a reduced memory footprint.
2026-05-31 14:04:10 +02:00
Simon Binder 253cdfec8c Review feedback 2026-05-11 20:47:20 +02:00
Simon Binder e934c428b4 Add observe(statement:) to TransactionObserver 2026-05-05 22:06:06 +02:00
Gwendal Roué 21b1322e05 Fix Swiftlint warnings 2026-02-15 15:09:40 +01:00
Gwendal Roué 7f9d1503a0 Merge pull request #1850 from swift-everywhere/platform-fixes
Android and Windows platform import/conditional accommodation
2026-02-04 08:38:48 +01:00
Marc Prud'hommeaux 14567635e4 Android and Windows platform import/conditional accommodation 2026-02-03 17:56:04 -05:00
Marc Prud'hommeaux c8f0328413 Add Sendable conformance to DispatchQueueExecutor for Android and Windows 2026-02-03 10:44:33 +01:00
Gwendal Roué a3036feb48 Merge branch 'development' into sqlcipher-spm-upstream 2026-02-01 15:11:22 +01:00
Gwendal Roué 79276d7f68 Prepare support for SPM+SQLCipher 2026-02-01 14:43:24 +01:00
Gwendal Roué 14fdba1ef3 Rename CipherXxx APIs to SQLCipherXxx when possible 2026-02-01 14:43:24 +01:00
Gwendal Roué 8b5017714f Support more SQLCipher log destinations 2026-02-01 14:43:24 +01:00
Gwendal Roué a1a9c3aefe Make links appear as links in DocC 2026-02-01 12:37:49 +01:00
Gwendal Roué d664db9610 Enhance documentation formatting 2026-02-01 12:37:49 +01:00
Gwendal Roué 2c4492a098 Do not define CipherLogLevel as a frozen enum 2026-02-01 12:37:49 +01:00
Gwendal Roué c0ef0e0f99 Use the same logic for importing SQLCipher as in other files 2026-02-01 11:19:30 +01:00
Gwendal Roué 81a699cae9 Merge branch 'grdb_linux_changes' into development 2026-02-01 11:00:35 +01:00
Micah Moore bd954c6791 Removes GRDBSQLCipher import from SQLCipher conditional import in Database.swift to allow SQLCipher forkers versatility for defining pass-throughs to GRDB required sqlite variadic functions. 2026-01-19 13:37:41 -05:00
Micah Moore 2f94eb307a Adds Foundation import to Database+SQLCipher 2026-01-16 14:59:25 -05:00
Micah Moore c24bf5d118 SQLCipher adjustments to support forks which want to enable SQLCipher using traits/swiftSettings
- Adds Database+SQLCipher extension with SQLCipher operations, enabled by #if SQLITE_HAS_CODEC
- Adjusts Import Statements to import SQLCipher when SQLCipher trait is enabled (or SQLCipher swiftSetting is set)
2026-01-14 11:32:48 -05:00
Gwendal Roué bc5dd31366 Fix Swiftlint warnings 2025-12-30 10:31:13 +01:00
Gwendal Roué 3ee256e7e8 Common API for statements that must ignore interruption errors 2025-12-09 21:39:20 +01:00
Gwendal Roué 361599aacd Task cancellation should turn all SQLITE_INTERRUPT errors into CancellationError, including errors thrown by statement compilation
I did not know statement compilation could fail when database is interrupted until #1838. A ROLLBACK statement would not even compile due to the FTS5 statement leak reported in https://sqlite.org/forum/forumpost/137c7662b389fa18
2025-12-09 21:38:15 +01:00
Gwendal Roué 64a024097d Fix failing test for #1838 by reseting all prepared statements before retrying 2025-12-08 21:40:48 +01:00
Gwendal Roué 60ea10948b Protect PRAGMA query_only = 0 against SQLITE_INTERRUPT
This should fix a race condition about cancellation that happens during a read-only access.
2025-12-08 21:22:43 +01:00
Gwendal Roué 5dba64d545 Retry a rollback in case of SQLITE_INTERRUPT error
This should fix a race condition about cancellation that happens during a rollback
2025-12-08 21:11:26 +01:00
Tim De Jong a212bf9e89 It should be canImport(Darwin) not os(Darwin) 2025-10-12 18:03:57 +02:00
Tim De Jong 8e5b9ca9bd Fixed UUID fromDatabaseValue for non-Darwin platforms 2025-10-12 18:03:56 +02:00
Tim De Jong dc7d47c066 Fixed databaseValue build for non-Darwin platforms. 2025-10-12 18:03:56 +02:00
Tim De Jong 14f60ad48f Fixed fromDatabaseValue build under non-Darwin platforms 2025-10-12 18:03:56 +02:00
Tim De Jong e758fde941 Removed #if !os(Linux) in NSString.swift, NSData.swift and Date.swift. 2025-10-12 17:43:25 +02:00
Tim De Jong 7477e1cff8 Removed the #if !os(Linux) compiler directive in the Decimal extension, as it compiles fine under swift 6 2025-10-12 17:43:15 +02:00
Tim De Jong 2d6fe172c3 Import Foundation for CGFloat on non-Darwin platforms 2025-10-12 17:43:02 +02:00
Tim De Jong 0526853dde Fixed some linker errors caused by WAL absence on Linux. 2025-10-12 17:42:49 +02:00
Gwendal Roué f878d99733 Use SQLITE_HAS_CODEC instead of GRDBCIPHER when testing for SQLCipher 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.
2025-10-12 14:49:59 +02:00
Gwendal Roué 361a482b1e Enable SQLITE_ENABLE_SNAPSHOT by default and introduce SQLITE_DISABLE_SNAPSHOT 2025-10-12 14:03:09 +02:00
Gwendal Roué 8cba324d6e Refactor the SQLite import
We can not use `#if Trait` because Xcode does not enable those compiler flags. Always count on Apple for delivering the best quality software.

So now we import the default SPM SQLite last, after all other cases have been excluded.

The GRDB framework (GRDB.xcodeproj and GRDB via CocoaPods) is distinct from the default SPM trait, so we detect it with GRDBFRAMEWORK.
2025-10-04 17:56:06 +02:00
Gwendal Roué b1b83abd8b Simplify the compiler checks for the availability of SQLite snapshots 2025-10-04 14:15:13 +02:00
Gwendal Roué 3f27fb9289 Fix #1820
The regression was introduced by c7bbebc
2025-09-29 19:35:00 +02:00
Gwendal Roué 9ef5e2c8eb Simplify error messages 2025-09-23 17:12:27 +02:00
Gwendal Roué f5dc68fc6f Fix typos 2025-09-23 17:12:27 +02:00
Gwendal Roué b210ec7428 View Records guide 2025-09-23 17:12:27 +02:00
Gwendal Roué 99ecf76a77 Support primary key when testing the existence of an association to a view 2025-09-23 17:12:27 +02:00