Gwendal Roué
9ef5e2c8eb
Simplify error messages
2025-09-23 17:12:27 +02:00
Gwendal Roué
e1abafaae3
Ignore schema source during migrations
2025-09-23 17:12:27 +02:00
Gwendal Roué
9518d74fa6
Improve error message
2025-09-23 17:12:27 +02:00
Gwendal Roué
c7bbebc80f
Change the way we count changes in order to support INSTEAD OF triggers
...
Database.changesCount calls sqlite3_changes(), whose documentation says:
> https://sqlite.org/c3ref/changes.html
> Changes to a view that are intercepted by INSTEAD OF triggers are not counted.
Since we want to support INSTEAD OF triggers well, so that record types can be based on views, we switch to sqlite3_total_changes().
2025-09-23 17:12:27 +02:00
Gwendal Roué
79ce0ff5f3
Avoid a compiler warning
2025-09-10 07:12:53 +02:00
Gwendal Roué
b4f3a83755
Remove SwiftLint warning
...
If we don't have warnings about explicit nil initialization, then we have a warning about the name of a disabled rule which is now deprecated. In all cases, we have a warning.
So let's just write 2025 Swift, ignore that rule, and call it a day.
2025-09-02 08:07:16 +02:00
Gwendal Roué
d1a2cb0948
All closures that accept DatabaseComponents can throw
2025-05-12 20:33:18 +02:00
Gwendal Roué
034b241e71
Rename ColumnsProvider to DatabaseComponents
2025-05-11 13:10:19 +02:00
Gwendal Roué
814146c40d
DocC
2025-05-11 11:56:21 +02:00
Gwendal Roué
fedcdef65e
Fix typo
2025-05-11 11:21:48 +02:00
Gwendal Roué
98e2812089
Convenience api for updating a single column
2025-05-11 10:58:09 +02:00
Gwendal Roué
004968517e
Update more documentation with the closure syntax
2025-05-10 17:43:22 +02:00
Gwendal Roué
f635aea2f2
Update more documentation with the closure syntax
2025-05-10 16:38:02 +02:00
Gwendal Roué
d6ff3b14d4
DocC
2025-05-10 15:34:10 +02:00
Gwendal Roué
6cc3116ff4
TableAlias is generic
2025-05-10 14:52:48 +02:00
Gwendal Roué
430141344d
Update more documentation with the closure syntax
2025-05-10 09:36:14 +02:00
Gwendal Roué
190ccda727
Rename deleteAndFetchStatement(_:select:) for consistency
2025-05-10 09:36:14 +02:00
Gwendal Roué
ed402d5de6
Use closure syntax for batch updates
2025-05-10 09:36:14 +02:00
Gwendal Roué
ed98ac30e0
DocC
2025-05-10 09:36:14 +02:00
Gwendal Roué
35fa28ab90
QueryInterfaceRequest.select(_:as:) with ColumnsProvider
2025-05-10 09:36:14 +02:00
Gwendal Roué
a89bd88340
Prefer key paths over closures, except in tests
...
Don't use key paths in tests because they are Swift 6.1+ only
2025-05-10 09:36:14 +02:00
Gwendal Roué
b01f6da3cf
Remove TODO
2025-05-10 09:36:14 +02:00
Gwendal Roué
e7fdd65072
deleteAndFetchStatement(_,selection:) with ColumnsProvider
2025-05-10 09:36:14 +02:00
Gwendal Roué
f69ca1a573
Build aggregates from ColumnsProvider
2025-05-10 09:36:14 +02:00
Gwendal Roué
ce238b6643
Build requests from ColumnsProvider
2025-05-10 09:36:13 +02:00
Gwendal Roué
494e697e94
Warn against selectID() when the ID type is an optional.
2025-02-12 08:25:27 +01:00
Gwendal Roué
87b236dfe0
selectID
...
This reverts 7ffc332327
At the time, selectID was replaced with selectPrimaryKey(as:) because:
> Since Optional is a database value like others, selectID would be a request of optionals for records with an optional ID type:
>
> struct Player: Identifiable, MutablePersistableRecord {
> var id: Int64?
> }
>
> Player.selectID() // QueryInterface<Int64?>
>
> This is not good, because primary keys are not null. And those requests would fetch impractical types such as [Int64?], Set<Int64?>, Int64??.
This problem is reintroduced, but we now recommend against optional ids in https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/recordrecommendedpractices . And record with optional ids can use selectPrimaryKey(as:).
2025-02-11 20:47:49 +01:00
Gwendal Roué
2c49a69f43
Raise a fatal error when the users filters a database view by primary key
...
Fixes #1648
2024-10-12 15:41:36 +02:00
Gwendal Roué
972aa33f68
Avoid optionals in JSON Data to String conversions
2024-09-22 10:10:01 +02:00
Gwendal Roué
46e15616a7
[BREAKING] macOS 10.15+
2024-09-21 14:28:24 +02:00
Gwendal Roué
e4a4735494
[BREAKING] tvOS 13+
2024-09-21 13:57:35 +02:00
Gwendal Roué
8c40592955
[BREAKING] iOS 13+
2024-09-21 13:57:23 +02:00
Gwendal Roué
3728628e5f
Association is Sendable
2024-09-15 12:10:13 +02:00
Gwendal Roué
461db6c4ac
Feed database promises with Sendable values
2024-09-15 11:12:39 +02:00
Gwendal Roué
6a29d6c081
[BREAKING] Prefer Collection over Sequence for filter(keys:) and derived APIs
...
We were frequently turning those sequences into an Array in order to check their emptiness, and generally were not sure we'd iterate a sequence only once.
Also use `some Sequence` and `some Collection` whenever possible.
2024-09-08 12:52:27 +02:00
Gwendal Roué
56e2ab85b7
SQLAssociationCondition is Sendable
2024-08-25 18:06:29 +02:00
Gwendal Roué
1036371dff
DatabasePromise is Sendable
2024-08-25 18:06:29 +02:00
Gwendal Roué
bcd6e03d7a
[BREAKING] databaseUUIDEncodingStrategy depends on the column
2024-08-25 14:06:44 +02:00
Gwendal Roué
7a8a9a9363
[BREAKING] databaseDateEncodingStrategy depends on the column
2024-08-25 14:06:35 +02:00
Gwendal Roué
1fe4df9438
[BREAKING] databaseDataEncodingStrategy depends on the column
2024-08-25 14:00:53 +02:00
Gwendal Roué
6157a40dad
Fix DocC warnings
2024-08-24 16:34:35 +02:00
Gwendal Roué
79cb862478
[BREAKING] watchOS 7+
...
Rationale: https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836
2024-08-24 15:45:38 +02:00
Gwendal Roué
bb789e3dee
QueryInterfaceRequest.deleteAndFetchIds
2024-06-05 18:42:36 +02:00
Gwendal Roué
b312d4cf5a
Add missing DocC links to cast(_:as:)
2024-06-05 18:36:24 +02:00
Gwendal Roué
f335123c2b
Update link to SQLite RETURNING caveats
2024-06-05 18:23:56 +02:00
Gwendal Roué
87fdd9a66f
cast function
2024-03-23 10:47:19 +01:00
Gwendal Roué
7a7ee554c7
OrderedRequest.withStableOrder()
2023-10-12 09:17:50 +02:00
Gwendal Roué
f4ac0ab119
Make it possible to observe the supplementary fetches
2023-10-08 20:41:05 +02: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é
8cc52983b7
Introduce SQLFunctionFlags
2023-10-01 15:39:47 +02:00