Commit Graph
145 Commits
Author SHA1 Message Date
Gwendal Roué c93ba4fba8 WIP 2025-01-17 17:52:52 +01:00
Gwendal Roué 1e354ba79c Delete the rationale for Sendable records
... because the reality is that I just don't know how to relax this requirement.

See:

- https://www.youtube.com/watch?v=JmrnE7HUaDE
- https://forums.swift.org/t/swiftserverconf-feedback-on-leveraging-structured-concurrency-in-your-applications/75176
2025-01-02 17:07:55 +01:00
Gwendal Roué c97f633022 More documentation of database schema methods 2024-10-13 11:28:14 +02:00
Gwendal Roué 13b6c9d36b Split database schema documentation into several files, and restore the overview of database schema features
Fixes #1623
2024-10-13 10:54:13 +02:00
Gwendal Roué a9fa2871aa Document the requirements 2024-10-06 18:19:11 +02:00
Rob Amos 8c5396898a Add DatabaseValueConvertible tip 2024-10-06 23:18:13 +11:00
Gwendal Roué a6b15684c3 Improve migration notes for ValueObservation 2024-09-29 13:27:07 +02:00
Gwendal Roué bb712a612e Rewrite the "Choosing between Synchronous and Asynchronous Database Accesses" section 2024-09-28 17:45:59 +02:00
Gwendal Roué 20818ee819 Remove the Record class from the documentation 2024-09-28 13:35:11 +02:00
Gwendal Roué 8dbce53ec5 SwiftConcurrency.md 2024-09-27 17:34:32 +02:00
Gwendal Roué 9b6a3b9ec6 SwiftConcurrency.md
ChatGPT remarks:

# Overview Section:

The phrase "GRDB optimally schedules those database access closures, in the best interest of the application" is vague and could benefit from more detail on how the scheduling optimizes for concurrency.

# Concurrency Warnings in Swift 6:

"We will address these issues, and provide general guidance in the following sections." This sentence suggests that detailed solutions will be discussed, but it is unclear how each error is related to the following section titles. A more specific reference to which section will cover what would help orient the reader.

# Non-Sendable Record Types Section:

The FAQ format is useful, but it could overwhelm the reader. Breaking up the FAQ into subsections with more concise answers or reordering it based on common issues could improve readability.

# Shorthand Closure Notation Section:

The explanation of why shorthand notation leads to warnings is somewhat technical. It may be helpful to clarify what "may introduce data races" means in practical terms for less experienced developers.

# Choosing Between Synchronous and Asynchronous Database Access:

The section recommends using asynchronous access but leaves open-ended guidance like "this may slow down other tasks". Adding a more concrete explanation of how to balance performance between synchronous and asynchronous approaches would benefit developers.

# General Clarification on Sendable:

Throughout the document, Sendable is mentioned frequently, but less-experienced developers might not fully understand why it matters. A short section or footnote on what Sendable is and why it’s important in Swift 6 concurrency might help provide context for readers unfamiliar with the concept.
2024-09-26 13:27:13 +02:00
Gwendal Roué cb001cbaa3 SwiftConcurrency.md 2024-09-26 09:43:19 +02:00
Gwendal Roué 521d7847a4 More GRDB 7 migration and Swift concurrency documentation 2024-09-25 20:05:57 +02:00
Gwendal Roué bc98fdb359 SwiftConcurrency.md 2024-09-24 08:58:07 +02:00
Gwendal Roué e7e5956698 SwiftConcurrency.md 2024-09-23 18:42:45 +02:00
Gwendal Roué aa7c528ef3 Swift Concurrency Guide: GlobalActorIsolatedTypesUsability 2024-09-22 13:50:10 +02:00
Gwendal Roué 7f1a3fd813 Swift Concurrency Guide WIP 2024-09-22 13:50:10 +02:00
Gwendal Roué 173f363bdc TableRecord.databaseSelection should be declared as a computed property 2024-09-21 17:21:59 +02:00
Gwendal Roué 900180dafd [BREAKING] Prefer any DatabaseReader and DatabaseWriter 2024-09-21 16:50:03 +02:00
Gwendal Roué 58a2e04736 Mark ValueObservation starting methods as @preconcurrency
I guess the compiler will learn to stop emitting warnings eventually.

https://mjtsai.com/blog/2024/09/20/unwanted-swift-concurrency-checking/
2024-09-21 12:30:38 +02:00
Gwendal Roué bdb7d84086 [BREAKING] ValueObservation MainActor scheduling
Breaking because before iOS 13, macOS 10.15, tvOS 13, there is no longer any default scheduler
2024-09-21 12:30:38 +02:00
Gwendal Roué e1a384009a [BREAKING] Async sequences built from ValueObservation schedule values and errors on the cooperative thread pool by default. 2024-09-21 12:19:39 +02:00
Gwendal Roué 2845570929 Fix DocC warnings 2024-09-15 14:27:19 +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é cb1bd83777 Document that async methods can throw CancellationError 2024-09-01 15:35:37 +02:00
Gwendal Roué d6b91eec85 [BREAKING] DatabaseReader async methods support Task cancellation 2024-09-01 15:35:37 +02:00
Gwendal Roué 849bba2820 Refactor ValueReducer for Swift concurrency
The fetching facet of a ValueReducer is Sendable.
2024-08-27 08:31:28 +02:00
Gwendal Roué 1fe4df9438 [BREAKING] databaseDataEncodingStrategy depends on the column 2024-08-25 14:00:53 +02:00
Gwendal Roué 1de32c267b [BREAKING] Remove DatabaseFuture and concurrentRead
That's one less DispatchSemaphore. We don't need this method anymore.
2024-08-25 11:07:05 +02:00
Gwendal Roué 451a9eb493 [BREAKING] Remove Configuration.defaultTransactionKind
GRDB now defaults read-only transactions to DEFERRED, and write transactions to IMMEDIATE. See https://github.com/groue/GRDB.swift/issues/1483 for some context.
2024-08-25 08:22:07 +02:00
Gwendal Roué 29eb04c39a [BREAKING] iOS 12+ 2024-08-24 15:45:38 +02:00
Gwendal Roué bde61b26ab Rewrite SingleRowTables, accounting for nullable columns
This addresses https://github.com/groue/GRDB.swift/discussions/1526
2024-04-21 15:02:52 +02:00
Gwendal Roué c8bb0a4799 Improve the documentation about the scheduling of ValueObservation fetches 2024-04-21 14:42:47 +02:00
Gwendal Roué 5413dcfeeb Remove jsonErrorPosition unless GRDBCUSTOMSQLITE || GRDBCIPHER
For some reason, if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) has stopped being able to skip the test (WTF?)
2024-03-19 12:15:47 +01:00
Gwendal Roué d0fc34b199 Recommend IMMEDIATE transactions in the Sharing a Database guide
Fix #1483
2024-01-17 20:04:39 +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 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é 93462cfd2c Documentation 2023-11-26 10:33:00 +01:00
Gwendal Roué a8ed98e414 Mention undetected changes in the Database Sharing Guide 2023-11-25 16:50:01 +01:00
Gwendal Roué f1a8c5ac92 Wording 2023-11-25 16:49:37 +01:00
Gwendal Roué 56ad833ab7 New Dealing with Undetected Changes documentation chapter 2023-11-25 15:32:35 +01:00
Gwendal Roué 1a16bdeac8 TransactionObserver.databaseDidChange() 2023-11-25 13:30:23 +01:00
Gwendal Roué 5e749eb50b Document that changes performed by SQLite statements that are not compiled and executed by GRDB are not detected. 2023-11-24 14:10:57 +01:00
Gwendal Roué 46ad19d2e3 Documentation 2023-11-02 14:03:52 +01:00
Gwendal Roué 38bb8d3505 Backport temporary copies from GRDBSnapshotTesting 2023-10-28 18:38:15 +02:00
Gwendal Roué 565335ea0d Update documentation 2023-10-15 09:06:28 +02:00