Commit Graph
111 Commits
Author SHA1 Message Date
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é 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é edc1d646f0 [BREAKING] Bump minimum Swift version to 6.1 2025-10-04 13:53:38 +02:00
Gwendal Roué 24e0f5ddeb Make throwing row accessors public 2025-07-20 13:00:12 +02:00
Gwendal Roué b079136cd5 Fix compiler warnings about ISO8601DateFormatter concurrency 2024-09-14 17:24:16 +02:00
Gwendal Roué 7747211691 [BREAKING] databaseDateDecodingStrategy depends on the column 2024-08-25 14:06:57 +02:00
Gwendal Roué 95ca9f5bf3 [BREAKING] databaseDataDecodingStrategy depends on the column 2024-08-25 14:06:50 +02:00
Gwendal Roué 9e1ff42249 [BREAKING] Rename CSQLite to GRDBSQLite
Fix #1528
2024-08-24 18:15:57 +02:00
Gwendal Roué 9cd1d849cc [BREAKING] Stop exporting SQLite 2024-08-24 17:25:35 +02:00
Steven RoebertandGwendal Roué 0ae3f32f7f Added compiler checks for Swift 6 specific code
Co-authored-by: Gwendal Roué <gr@pierlis.com>
2024-07-13 12:53:00 +02:00
Steven Roebert c977cb8226 Implemented support for single value decoding in _RowDecoder 2024-07-13 11:48:02 +02:00
Gwendal Roué 53c40fd80f Fix Swiftlint warning 2024-04-21 17:45:58 +02:00
Gwendal Roué f1ff7f2a2a Fix compiler warnings 2024-04-21 12:20:37 +02:00
Gwendal Roué 7110a1fab3 Fix failing tests for decodeNil()
Fix https://github.com/groue/GRDB.swift/issues/1531
2024-04-21 12:13:24 +02:00
Gwendal Roué 3521030e13 Test _RowDecoder.KeyedContainer.allKeys, contains(_:), and support some nested keyed containers 2024-04-21 12:13:24 +02:00
Gwendal Roué ac8c4aea63 Report correct error when decoding NULL into Date or Data
Fixes #1512
2024-03-21 14:25:12 +01:00
Gwendal Roué 43ced9b2f0 Trivial Sendable conformances
Either added, either made explicitly unavailable.
2024-03-17 18:25:04 +01:00
Gwendal Roué 5a42d78e06 Data decoding and encoding strategies
Users must be able to store JSON data as text in the database.
2023-10-04 19:55:12 +02:00
Gwendal Roué 266efa041c Expose FetchableRecordDecoder 2023-04-29 17:15:54 +02:00
Gwendal Roué ac214e6760 SE-0345: if let shorthand for shadowing an existing optional variable 2023-01-30 08:00:47 +01:00
Gwendal Roué 4307f6a680 Fix Swiftlint warnings 2022-11-06 18:43:00 +01:00
Gwendal Roué 811d287bd9 Row.withUnsafeData 2022-11-06 16:02:36 +01:00
Gwendal Roué 1818534513 DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué e0786537db BREAKING: replace Int32 with CInt everywhere it is possible 2022-08-21 21:22:34 +02:00
Gwendal Roué 895964de16 BREAKING: Throwing FetchableRecord.init(row:) 2022-08-21 21:22:34 +02:00
Gwendal Roué a9fcf1b9c1 SE-0335, SE-0341, SE-0346, SE-0352, SE-0358: some, any, primary associated types 2022-08-21 21:22:34 +02:00
Gwendal Roué dd55175978 SE-0345: if let x { }
https://github.com/apple/swift-evolution/blob/main/proposals/0345-if-let-shorthand.md
2022-08-21 21:22:34 +02:00
Gwendal Roué 58293befc9 BREAKING: Optional is a database value like others 2022-08-21 21:22:34 +02:00
Gwendal Roué 23cbf13af0 Swift 5.7 required: Availability checks 2022-08-21 19:21:57 +02:00
Gwendal Roué c30b49117b If a scope is found, there is no point searching for prefetched rows 2022-03-04 12:04:02 +01:00
Gwendal Roué ec975819b7 Fix for container.decodeNil(forKey:) in the context of including(all:) 2022-03-04 11:55:53 +01:00
Gwendal Roué 8ed16f4440 Fix some compiler warnings with -Xfrontend -warn-concurrency
https://twitter.com/olebegemann/status/1467893554915782668
2021-12-07 09:23:37 +01:00
Gwendal Roué 53c662d179 Decode optional collections from prefetched rows
This allows to define records that only decode to-many associations when they are eager-loaded.

See https://github.com/groue/GRDB.swift/issues/1084#issuecomment-948880910
2021-10-23 12:40:55 +02:00
Gwendal Roué e6e2536f6b Reverse DatabaseColumnDecodingStrategy
It does not convert coding keys to columns, but columns to CodingKeys, exactly as JSONDecoder.KeyDecodingStrategy
2021-08-29 13:52:36 +02:00
Gwendal Roué 86e4adf860 Spot a design flaw 2021-08-29 10:08:08 +02:00
Gwendal Roué 427a00582f Rename keyDecodingStrategy to columnDecodingStrategy 2021-08-29 09:55:06 +02:00
Gwendal Roué 6f024373b3 Fix failing test 2021-08-29 09:51:31 +02:00
Gwendal Roué e60a31f401 Fix failing test 2021-08-29 09:40:32 +02:00
Gwendal Roué d567630966 Column decoding strategy only applies to columns 2021-08-29 08:55:39 +02:00
Gwendal Roué 42045ad8fb Merge remote-tracking branch 'origin/development' into pr1029 2021-08-29 08:37:13 +02:00
Gwendal Roué 33e2c379db Make it clear that strategies apply to columns only
...and not to row scopes or prefetched records
2021-08-28 16:24:53 +02:00
Gwendal Roué 987b8a48e5 Key coding strategies transform keys into columns
They are not String transformers
2021-08-28 15:41:12 +02:00
Gwendal Roué 665770c50c Remove all ABI annotations 2021-08-21 13:14:54 +02:00
Scott Berrevoets 79abf62a47 Fix name and convert Decodables as well 2021-08-14 21:45:35 -07:00
Scott Berrevoets 4ab7f1cf3e Add support for encoding as well 2021-08-12 20:12:10 -07:00
Scott Berrevoets cdc7805471 Add option for converting snake case
This adds an option to convert column names from snake case to camel
case, similar to how JSONDecoder works. In fact, the implementation here
is largely based on JSONDecoder's implementation.
2021-08-12 20:11:54 -07:00
Gwendal Roué 620eb6f21c Default DatabaseValueConvertible+Codable implementation uses the JSON format 2021-07-04 17:34:31 +02:00
Chris Ballinger 984dea156c Allow access to Encoder and Decoder from KeyedCodingContainer 2021-03-27 08:57:44 -07:00
Gwendal Roué 4dd8042894 Make it possible to decode arrays of scalars from including(all:) 2021-03-08 14:21:35 +01:00
Gwendal Roué b7c57dc7f2 Attempt at clarifying the (complex) decoding api
The difficulty is due to fast decoding of StatementColumnConvertible, and non-copied Data, from raw SQLite statement.

We want it to be inlinable, and possible in nested rows.

Added missing tests for nested rows
2021-02-25 20:45:12 +01:00