Skip to content

Commit aa0079a

Browse files
committed
Merge branch 'development'
2 parents fd78890 + 74ef238 commit aa0079a

File tree

114 files changed

+1073
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1073
-631
lines changed

.github/workflows/CI.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
1+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
22

33
name: "GRDB CI"
44

@@ -40,17 +40,17 @@ jobs:
4040
fail-fast: false
4141
matrix:
4242
include:
43-
- xcode: "Xcode_16.1.app"
44-
runsOn: macOS-14
43+
- xcode: "Xcode_16.4.app"
44+
runsOn: macOS-15
4545
destination: "platform=macOS"
4646
name: "macOS"
47-
- xcode: "Xcode_16.1.app"
48-
runsOn: macOS-14
49-
destination: "OS=18.1,name=iPhone 16 Pro"
47+
- xcode: "Xcode_16.4.app"
48+
runsOn: macOS-15
49+
destination: "OS=18.5,name=iPhone 16 Pro"
5050
name: "iOS"
51-
- xcode: "Xcode_16.1.app"
52-
runsOn: macOS-14
53-
destination: "OS=18.1,name=Apple TV"
51+
- xcode: "Xcode_16.4.app"
52+
runsOn: macOS-15
53+
destination: "OS=18.5,name=Apple TV"
5454
name: "tvOS"
5555
steps:
5656
- uses: actions/checkout@v5
@@ -66,9 +66,9 @@ jobs:
6666
fail-fast: false
6767
matrix:
6868
include:
69-
- xcode: "Xcode_16.1.app"
70-
runsOn: macOS-14
71-
name: "Xcode 16.1"
69+
- xcode: "Xcode_16.4.app"
70+
runsOn: macOS-15
71+
name: "Xcode 16.4"
7272
steps:
7373
- uses: actions/checkout@v5
7474
- name: ${{ matrix.name }}
@@ -83,9 +83,9 @@ jobs:
8383
fail-fast: false
8484
matrix:
8585
include:
86-
- xcode: "Xcode_16.1.app"
87-
runsOn: macOS-14
88-
name: "Xcode 16.1"
86+
- xcode: "Xcode_16.4.app"
87+
runsOn: macOS-15
88+
name: "Xcode 16.4"
8989
steps:
9090
- uses: actions/checkout@v5
9191
- name: ${{ matrix.name }}
@@ -100,9 +100,9 @@ jobs:
100100
fail-fast: false
101101
matrix:
102102
include:
103-
- xcode: "Xcode_16.1.app"
104-
runsOn: macOS-14
105-
name: "Xcode 16.1"
103+
- xcode: "Xcode_16.4.app"
104+
runsOn: macOS-15
105+
name: "Xcode 16.4"
106106
steps:
107107
- uses: actions/checkout@v5
108108
- name: ${{ matrix.name }}
@@ -117,9 +117,9 @@ jobs:
117117
fail-fast: false
118118
matrix:
119119
include:
120-
- xcode: "Xcode_16.1.app"
121-
runsOn: macOS-14
122-
name: "Xcode 16.1"
120+
- xcode: "Xcode_16.4.app"
121+
runsOn: macOS-15
122+
name: "Xcode 16.4"
123123
steps:
124124
- uses: actions/checkout@v5
125125
- name: ${{ matrix.name }}
@@ -134,9 +134,9 @@ jobs:
134134
fail-fast: false
135135
matrix:
136136
include:
137-
- xcode: "Xcode_16.1.app"
138-
runsOn: macOS-14
139-
name: "Xcode 16.1"
137+
- xcode: "Xcode_16.4.app"
138+
runsOn: macOS-15
139+
name: "Xcode 16.4"
140140
steps:
141141
- uses: actions/checkout@v5
142142
- name: ${{ matrix.name }}

.spi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ version: 1
22
builder:
33
configs:
44
- documentation_targets: [GRDB]
5-
swift_version: 6.0
5+
swift_version: 6.1

CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
77

88
#### 7.x Releases
99

10+
- `7.9.x` Releases - [7.9.0](#790)
1011
- `7.8.x` Releases - [7.8.0](#780)
1112
- `7.7.x` Releases - [7.7.0](#770) - [7.7.1](#771)
1213
- `7.6.x` Releases - [7.6.0](#760) - [7.6.1](#761)
@@ -140,6 +141,37 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
140141

141142
---
142143

144+
## 7.9.0
145+
146+
Released December 13, 2025
147+
148+
- **Breaking Change**: Simplify the compiler checks for the availability of SQLite snapshots by [@groue](https://github.com/groue) in [#1826](https://github.com/groue/GRDB.swift/pull/1826)
149+
150+
This change aims at easing Linux and Android compatibility.
151+
152+
**The library requirements are raised to Swift 6.1+, Xcode 16.3+.**
153+
154+
- **Breaking Change**: Accept multiple SQLCipher libraries by [@groue](https://github.com/groue) in [#1819](https://github.com/groue/GRDB.swift/pull/1819)
155+
156+
This change aims at easing building GRDB against various SQLCipher flavors.
157+
158+
**The compiler flag that enables new GRDB APIs for SQLCipher is now `SQLITE_HAS_CODEC`.**
159+
160+
- **Fixed**: Fix cancellation of async tasks that use the FTS5 full-text engine by [@groue](https://github.com/groue) in [#1839](https://github.com/groue/GRDB.swift/pull/1839)
161+
162+
This workarounds an [SQLite bug](https://sqlite.org/forum/forumpost/95413eb410) that would trigger a GRDB crash, and improves the robustness of the library regarding database accesses cancellation and database interruption.
163+
164+
- **New**: Improve the ergonomics of `DatabaseMigrator.registerMigration(_:foreignKeyChecks:merging:migrate)`, introduced in [#1818](https://github.com/groue/GRDB.swift/pull/1818), by accepting that the name of the merged migration is included in the set of merged migrations:
165+
166+
```swift
167+
// Used to fail, now OK:
168+
migrator.registerMigration("v3", merging: ["v1", "v2", "v3"]) { ... }
169+
// ~~~~ ~~~~
170+
171+
// The above code is equivalent to:
172+
migrator.registerMigration("v3", merging: ["v1", "v2"]) { ... }
173+
```
174+
143175
## 7.8.0
144176

145177
Released October 2, 2025
@@ -4370,7 +4402,7 @@ Released April 3, 2017
43704402

43714403
**Breaking Changes**
43724404

4373-
- SQLite C API is now available right from the GRBD module: you don't need any longer to import `SQLiteiPhoneOS` module et al (see documentation for [Raw SQLite Pointers](https://github.com/groue/GRDB.swift#raw-sqlite-pointers)).
4405+
- SQLite C API is now available right from the GRDB module: you don't need any longer to import `SQLiteiPhoneOS` module et al (see documentation for [Raw SQLite Pointers](https://github.com/groue/GRDB.swift#raw-sqlite-pointers)).
43744406
- The [manual installation procedure for WatchOS extensions](https://github.com/groue/GRDB.swift#installation) has changed.
43754407
- [Carthage](https://github.com/Carthage/Carthage) is no longer supported. At the present time it is unable to support the various frameworks built by GRDB (system SQLite, SQLCipher, custom SQLite builds, etc.)
43764408

Documentation/DemoApps/GRDBDemo/GRDBDemo.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemo;
383383
PRODUCT_NAME = "$(TARGET_NAME)";
384384
SWIFT_EMIT_LOC_STRINGS = YES;
385-
SWIFT_VERSION = 6.0;
385+
SWIFT_VERSION = 6.1;
386386
TARGETED_DEVICE_FAMILY = "1,2";
387387
};
388388
name = Debug;
@@ -411,7 +411,7 @@
411411
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemo;
412412
PRODUCT_NAME = "$(TARGET_NAME)";
413413
SWIFT_EMIT_LOC_STRINGS = YES;
414-
SWIFT_VERSION = 6.0;
414+
SWIFT_VERSION = 6.1;
415415
TARGETED_DEVICE_FAMILY = "1,2";
416416
};
417417
name = Release;
@@ -427,7 +427,7 @@
427427
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoTests;
428428
PRODUCT_NAME = "$(TARGET_NAME)";
429429
SWIFT_EMIT_LOC_STRINGS = NO;
430-
SWIFT_VERSION = 6.0;
430+
SWIFT_VERSION = 6.1;
431431
TARGETED_DEVICE_FAMILY = "1,2";
432432
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/GRDBDemo";
433433
};
@@ -444,7 +444,7 @@
444444
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoTests;
445445
PRODUCT_NAME = "$(TARGET_NAME)";
446446
SWIFT_EMIT_LOC_STRINGS = NO;
447-
SWIFT_VERSION = 6.0;
447+
SWIFT_VERSION = 6.1;
448448
TARGETED_DEVICE_FAMILY = "1,2";
449449
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/GRDBDemo";
450450
};

GRDB.swift.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'GRDB.swift'
3-
s.version = '7.8.0'
3+
s.version = '7.9.0'
44

55
s.license = { :type => 'MIT', :file => 'LICENSE' }
66
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
99
s.source = { :git => 'https://github.com/groue/GRDB.swift.git', :tag => "v#{s.version}" }
1010
s.module_name = 'GRDB'
1111

12-
s.swift_versions = ['6']
12+
s.swift_versions = ['6.1']
1313
s.ios.deployment_target = '13.0'
1414
s.osx.deployment_target = '10.15'
1515
s.watchos.deployment_target = '7.0'
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
2121
ss.framework = 'Foundation'
2222
ss.library = 'sqlite3'
2323
ss.xcconfig = {
24-
'OTHER_SWIFT_FLAGS' => '$(inherited) -D SQLITE_ENABLE_FTS5',
24+
'OTHER_SWIFT_FLAGS' => '$(inherited) -D SQLITE_ENABLE_FTS5 -D GRDBFRAMEWORK',
2525
}
2626
end
2727

GRDB.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@
292292
56BB6EA91D3009B100A1CA52 /* SchedulingWatchdog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */; };
293293
56BCA2622E6C28F800E4F08D /* DatabaseSchemaSourceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56BCA2612E6C28EF00E4F08D /* DatabaseSchemaSourceTests.swift */; };
294294
56BF2282241781C5003D86EB /* UtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56BF2281241781C5003D86EB /* UtilsTests.swift */; };
295+
56C7979B2EE99BD000AA265D /* Issue1838Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56C7979A2EE99BD000AA265D /* Issue1838Tests.swift */; };
295296
56CC922C201DFFB900CB597E /* DropWhileCursorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56CC922B201DFFB900CB597E /* DropWhileCursorTests.swift */; };
296297
56CC9243201E034D00CB597E /* PrefixWhileCursorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56CC9242201E034D00CB597E /* PrefixWhileCursorTests.swift */; };
297298
56CC9246201E058100CB597E /* DropFirstCursorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56CC9245201E058000CB597E /* DropFirstCursorTests.swift */; };
@@ -802,6 +803,7 @@
802803
56C3F7521CF9F12400F6A361 /* DatabaseSavepointTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseSavepointTests.swift; sourceTree = "<group>"; };
803804
56C48E731C9A9923005DF1D9 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
804805
56C494401ED7255500CC72AF /* GRDBDeploymentTarget.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = GRDBDeploymentTarget.xcconfig; sourceTree = "<group>"; };
806+
56C7979A2EE99BD000AA265D /* Issue1838Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Issue1838Tests.swift; sourceTree = "<group>"; };
805807
56CC922B201DFFB900CB597E /* DropWhileCursorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropWhileCursorTests.swift; sourceTree = "<group>"; };
806808
56CC9242201E034D00CB597E /* PrefixWhileCursorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrefixWhileCursorTests.swift; sourceTree = "<group>"; };
807809
56CC9245201E058000CB597E /* DropFirstCursorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DropFirstCursorTests.swift; sourceTree = "<group>"; };
@@ -1448,6 +1450,7 @@
14481450
56B964C21DA521450002DA19 /* FTS5TableBuilderTests.swift */,
14491451
5698ACCA1DA62A2D0056AF8C /* FTS5TokenizerTests.swift */,
14501452
56ED8A7E1DAB8D6800BD0ABC /* FTS5WrapperTokenizerTests.swift */,
1453+
56C7979A2EE99BD000AA265D /* Issue1838Tests.swift */,
14511454
);
14521455
name = FTS;
14531456
sourceTree = "<group>";
@@ -2130,6 +2133,7 @@
21302133
56D496C11D81373A008276D7 /* DatabaseQueueBackupTests.swift in Sources */,
21312134
562393721DEE104400A6B01F /* MapCursorTests.swift in Sources */,
21322135
56D496571D81303E008276D7 /* FoundationDateComponentsTests.swift in Sources */,
2136+
56C7979B2EE99BD000AA265D /* Issue1838Tests.swift in Sources */,
21332137
568C3F7A2A5AB2C300A2309D /* ForeignKeyDefinitionTests.swift in Sources */,
21342138
56D496701D81309E008276D7 /* RecordPrimaryKeyRowIDTests.swift in Sources */,
21352139
5622060C1E420EB3005860AC /* DatabaseQueueConcurrencyTests.swift in Sources */,

GRDB/Core/Configuration.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// Import C SQLite functions
2-
#if SWIFT_PACKAGE
3-
import GRDBSQLite
4-
#elseif GRDBCIPHER
2+
#if GRDBCIPHER // CocoaPods (SQLCipher subspec)
53
import SQLCipher
6-
#elseif !GRDBCUSTOMSQLITE && !GRDBCIPHER
4+
#elseif GRDBFRAMEWORK // GRDB.xcodeproj or CocoaPods (standard subspec)
75
import SQLite3
6+
#elseif GRDBCUSTOMSQLITE // GRDBCustom Framework
7+
// #elseif SomeTrait
8+
// import ...
9+
#else // Default SPM trait must be the default. It impossible to detect from Xcode.
10+
import GRDBSQLite
811
#endif
912

1013
#if !canImport(Darwin)

GRDB/Core/Database+Schema.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// Import C SQLite functions
2-
#if SWIFT_PACKAGE
3-
import GRDBSQLite
4-
#elseif GRDBCIPHER
2+
#if GRDBCIPHER // CocoaPods (SQLCipher subspec)
53
import SQLCipher
6-
#elseif !GRDBCUSTOMSQLITE && !GRDBCIPHER
4+
#elseif GRDBFRAMEWORK // GRDB.xcodeproj or CocoaPods (standard subspec)
75
import SQLite3
6+
#elseif GRDBCUSTOMSQLITE // GRDBCustom Framework
7+
// #elseif SomeTrait
8+
// import ...
9+
#else // Default SPM trait must be the default. It impossible to detect from Xcode.
10+
import GRDBSQLite
811
#endif
912

1013
extension Database {
@@ -138,7 +141,7 @@ extension Database {
138141
}
139142
}
140143

141-
#if GRDBCUSTOMSQLITE || GRDBCIPHER
144+
#if GRDBCUSTOMSQLITE || SQLITE_HAS_CODEC
142145
/// Returns information about a table or a view
143146
func table(_ tableName: String) throws -> TableInfo? {
144147
for schemaID in try fetchSchemaIdentifiers() {
@@ -572,7 +575,7 @@ extension Database {
572575
/// - precondition: table exists.
573576
private func fetchTableHasRowID(_ table: DatabaseObjectID) throws -> Bool {
574577
// Prefer PRAGMA table_list if available
575-
#if GRDBCUSTOMSQLITE || GRDBCIPHER
578+
#if GRDBCUSTOMSQLITE || SQLITE_HAS_CODEC
576579
// Maybe SQLCipher is too old: check actual version
577580
if sqlite3_libversion_number() >= 3037000 {
578581
return try self.table(for: table)!.isWithoutRowIDTable == false

GRDB/Core/Database+Statements.swift

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// Import C SQLite functions
2-
#if SWIFT_PACKAGE
3-
import GRDBSQLite
4-
#elseif GRDBCIPHER
2+
#if GRDBCIPHER // CocoaPods (SQLCipher subspec)
53
import SQLCipher
6-
#elseif !GRDBCUSTOMSQLITE && !GRDBCIPHER
4+
#elseif GRDBFRAMEWORK // GRDB.xcodeproj or CocoaPods (standard subspec)
75
import SQLite3
6+
#elseif GRDBCUSTOMSQLITE // GRDBCustom Framework
7+
// #elseif SomeTrait
8+
// import ...
9+
#else // Default SPM trait must be the default. It impossible to detect from Xcode.
10+
import GRDBSQLite
811
#endif
912

1013
import Foundation
@@ -510,6 +513,27 @@ extension Database {
510513
publicStatementArguments: configuration.publicStatementArguments)
511514
}
512515

516+
/// Always throws an error
517+
func statementCompilationDidFail(
518+
at statementStart: UnsafePointer<CChar>,
519+
withResultCode resultCode: CInt
520+
) throws -> Never {
521+
switch ResultCode(rawValue: resultCode) {
522+
case .SQLITE_INTERRUPT, .SQLITE_ABORT:
523+
// The only error that a user sees when a Task is cancelled
524+
// is CancellationError.
525+
try suspensionMutex.load().checkCancellation()
526+
default:
527+
break
528+
}
529+
530+
// Throw compilation failure
531+
throw DatabaseError(
532+
resultCode: resultCode,
533+
message: lastErrorMessage,
534+
sql: String(cString: statementStart))
535+
}
536+
513537
private func checkForAutocommitTransition() {
514538
if sqlite3_get_autocommit(sqliteConnection) == 0 {
515539
if autocommitState == .on {

0 commit comments

Comments
 (0)