Commit Graph
3975 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é 898e7b6abe Merge pull request #1662 from compnerd/c
Core: import `ucrt` on Windows for `strcmp`
2024-11-13 16:11:39 +01:00
Saleem Abdulrasool 77a4d17940 Core: import ucrt on Windows for strcmp
This uses the deprecated `strcmp` interface on Windows, which requires
the C library to be imported. Add the missing import to allow building
on Windows.
2024-11-12 11:12:27 -08:00
Saleem Abdulrasool c865a847fd Foundation: elide extensions on Windows to match Linux
Similar to Linux, elide some extensions on Windows. This is required to
build this module on Windows.
2024-11-12 11:10:07 -08: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
Janosch Hildebrand a741fb38f0 Fix DatabaseMigrator.hasSchemaChanges failing for readonly connections 2024-10-12 18:36:15 +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é 0aa8498620 DatabaseMigrator.hasSchemaChanges 2024-10-12 12:40:36 +02:00
Gwendal Roué 68d12916e6 Fix Swiftlint warning 2024-10-06 18:36:43 +02:00
Gwendal Roué 6a4f454464 Merge pull request #1649 from bok-/master
Add `DatabaseValueConvertible` tip for JSON columns
2024-10-06 18:30:23 +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é 97c0c72702 Merge pull request #1645 from philmitchell/coalesce
Add coalesce free function and Row method
2024-10-06 13:55:02 +02:00
Gwendal Roué a17d72e04c Make the top-level coalesce function work with collections of size zero and one. 2024-10-06 12:53:22 +02:00
Gwendal Roué 8cac458efc Use "real" column names in examples.
Also, remove "essential".
2024-10-06 12:42:10 +02:00
Gwendal Roué a13c1bec29 Add coalesce in DocC 2024-10-06 12:19:49 +02:00
Gwendal Roué c6781f46d2 Prefer Collection over Array
This allows the user to call those methods with an Array, or any other collection at hand (including lazy ones)

This change makes `return coalesce(columns.lazy.map { $0.name })` iterate lazily. Before this commit, `map` was returning a non-lazy Array.
2024-10-06 12:19:49 +02:00
Phil Mitchell d7754fa79c Add coalesce free function and Row method 2024-09-30 13:10:59 +10:00
Dianna 5f2185a118 use #if directives to conditionally @preconcurrency import the Dispatch module to enable building the package on linux 2024-09-29 21:44:34 +00:00
Gwendal Roué a6b15684c3 Improve migration notes for ValueObservation 2024-09-29 13:27:07 +02:00
Gwendal Roué 9302925081 Fix Swiftlint warnings 2024-09-28 18:02:05 +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é 073682c4f0 Remove the experimental flag on stabilized apis 2024-09-28 14:41:12 +02:00
Gwendal Roué 6b2ccebad3 AsyncValueObservation is Sendable
A Sendable async sequences plays well with apple/swift-async-algorithms
2024-09-28 13:36:40 +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é 2800530b12 Improve documentation of PersistenceContainer subscript getter 2024-09-22 12:51:40 +02:00
Gwendal Roué f7d85b00d1 Fixits 2024-09-22 12:50:58 +02:00
Gwendal Roué 972aa33f68 Avoid optionals in JSON Data to String conversions 2024-09-22 10:10:01 +02:00
Gwendal Roué 89aa353974 StrictConcurrency: databaseDecodingUserInfo and databaseEncodingUserInfo must be declared as a computed property 2024-09-22 10:10:01 +02:00
Gwendal Roué cc0b401f0a StrictConcurrency: FetchableRecord.databaseDecodingUserInfo must be declared as a computed property 2024-09-22 10:10:01 +02:00
Gwendal Roué 938ad7a086 Prefer Data over NSData 2024-09-22 09:29:59 +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é 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é 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é 7707bbd1e9 Fix Swiftlint warning 2024-09-21 10:39:36 +02:00