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
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é
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é
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é
9ef5e2c8eb
Simplify error messages
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
Gwendal Roué
37dde39557
Public Database.schemaSource and withSchemaSource(_:execute:)
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é
26ebd7e147
Update outdated comments
2025-09-23 17:12:27 +02:00
Gwendal Roué
9518d74fa6
Improve error message
2025-09-23 17:12:27 +02:00
Gwendal Roué
38f5226e95
Database.table(_:hasUniqueKey:) now accept views
2025-09-23 17:12:27 +02:00
Gwendal Roué
d7d61add23
DatabaseSchemaSource customizes the primary key of database views
2025-09-23 17:12:27 +02:00
Gwendal Roué
d040588849
Database.fetchPrimitivePrimaryKey(forTable:)
...
This method is necessary for the customization of schema introspection: it must be possible to fallback on the primitive SQLite schema introspection when needed.
2025-09-23 17:12:27 +02:00
Gwendal Roué
30313623eb
Make DatabaseSchemaID and DatabaseObjectID public
...
This is also a big cleanup opportunity.
We need public schema identifiers in order to support the customization of schema introspection.
2025-09-23 17:12:27 +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é
c97f633022
More documentation of database schema methods
2024-10-13 11:28:14 +02: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é
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é
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
Gwendal Roué
43ced9b2f0
Trivial Sendable conformances
...
Either added, either made explicitly unavailable.
2024-03-17 18:25:04 +01:00
Ben Barnett
27a4215424
Add schemaName parameter to foreign key checking functions
2023-12-08 18:22:49 +00:00
Ben Barnett
65167ec7da
Add schemaName parameter to table/view/triggerExists()
2023-12-08 18:22:49 +00:00
Ben Barnett
73489fc0e7
Add schemaName parameter to indexes(on:)
2023-12-08 18:22:49 +00:00
Ben Barnett
1aca8efa65
Add schemaName parameter to foreignKeys(on:)
2023-12-08 18:22:49 +00:00
Ben Barnett
a22bf83ae8
Split duplicate nested conditions into separate function
2023-12-07 18:32:34 +00:00
Ben Barnett
f00a974211
Add schemaName parameter to columns(in:)
2023-12-06 20:49:48 +00:00
Ben Barnett
ac475cc158
Add schemaName parameter to primaryKey(_:)
2023-12-06 20:32:17 +00:00
Gwendal Roué
8afd986790
Fix failing tests for Database.notifyChanges(in:) and master tables
2023-11-25 15:32:35 +01:00
Gwendal Roué
918afbd33e
Fix failing tests for Database.notifyChanges(in:) and regular tables
2023-11-25 14:39:13 +01:00
Gwendal Roué
206bf209af
Fix unneeded_synthesized_initializer Swiftlint warning
2023-07-29 10:00:42 +02:00
Gwendal Roué
dd85e699e2
Help handling of columns with no declared type
2023-07-09 17:16:08 +02:00
Gwendal Roué
c647840485
PrimaryKeyInfo exposes column types
2023-07-09 17:16:08 +02:00
Gwendal Roué
f633be4ba1
Fix test for #1360
2023-04-12 08:02:38 +02:00
Gwendal Roué
abaa14db83
Fix typo
2023-01-30 08:41:32 +01: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é
d3c289a320
Availability checks cleanup
2023-01-22 12:37:40 +01:00
Gwendal Roué
0bc49460d7
DatabaseSnapshotPool uses its own pool of connections
...
In the previous implementation, the snapshot pool would use the same reader connections as the database pool. This would create problem with reentrant reads. Let's make things simple, and not share any database connection.
2022-11-17 18:36:17 +01:00
Gwendal Roué
a71eb3d662
Introduce WALSnapshotToken
2022-11-13 18:28:54 +01:00
Gwendal Roué
ca079cab17
TODO
2022-11-08 19:28:09 +01:00
Gwendal Roué
754ced7b5e
Enhance DocC output for ForeignKeyViolation
2022-11-07 22:50:50 +01:00
Gwendal Roué
fb81ec6792
Migrations Guide in now a DocC article
2022-11-07 22:44:37 +01:00
Gwendal Roué
1818534513
DocC
2022-11-06 16:02:36 +01:00
Gwendal Roué
82b4d90a82
Xcode 14 RC doesn't ship with the Swift 5.6 stdlib
...
https://forums.swift.org/t/xcode-14-rc-cannot-specialize-protocol-type/60171
2022-09-09 08:16:55 +02:00
Gwendal Roué
040e5d9d87
WITHOUT ROWID check: prefer PRAGMA table_list when available
...
This avoids the undesired errors described in #945 .
2022-08-28 12:28:39 +02:00
Gwendal Roué
189430c1fe
PRAGMA table_list
2022-08-28 12:28:39 +02:00
Gwendal Roué
2a5626efea
Replace if let x = x with if let x
2022-08-22 20:40:00 +02:00
Gwendal Roué
5243db7fbc
Spelling
2022-08-21 21:22:34 +02:00
Gwendal Roué
c38d903f4d
Make RequestProtocols.swift easier to read
2022-08-21 21:22:34 +02:00