Commit Graph
55 Commits
Author SHA1 Message Date
Gwendal Roué 52a3d6ba23 Move the "Recommended Practices for Designing Record Types" to DocC 2023-04-10 09:51:38 +02:00
Gwendal Roué 54007a9ce1 Refactor demo apps for enhanced configuration management 2023-04-09 11:40:40 +02:00
Gwendal Roué 9798f9f9fa Update Package.resolved for demo apps 2023-03-12 12:40:38 +01:00
Gwendal Roué 1e5ee4b292 Fix Xcode 14.3 beta 2 warnings 2023-03-04 11:53:41 +01:00
Gwendal Roué 159a34bdf2 Demo apps: bump GRDBQuery to 0.6.0 2023-03-04 10:03:51 +01:00
Gwendal Roué 0b92c856ae Upgrade demo apps 2022-12-29 14:06:18 +01:00
Gwendal Roué 6e2e1f4889 Update documentation links 2022-12-29 14:06:18 +01:00
Gwendal Roué e3cc15707a Move ValueObservation documentation to DocC 2022-11-27 18:27:26 +01:00
Gwendal Roué 3074b61cb7 Move schema documentation to DocC 2022-11-27 11:07:13 +01:00
Gwendal Roué 90ec3c188b Host documentation on SPI 2022-11-11 11:34:02 +01:00
Gwendal Roué 19b0b6af3e http -> https 2022-11-08 08:45:37 +01:00
Gwendal Roué fb81ec6792 Migrations Guide in now a DocC article 2022-11-07 22:44:37 +01:00
Gwendal Roué 1c7b618a89 Parallelizable tests 2022-09-09 09:33:57 +02:00
Gwendal Roué d2dd18b3e5 Remove note and warning icons
Those are handled by Github now:
https://github.com/community/community/discussions/16925
2022-08-21 21:22:34 +02:00
Gwendal Roué a702fe6bc9 BREAKING: persistence callbacks, and support for RETURNING
- Replace performInsert, performUpdate, etc with callbacks: willInsert, aroundInsert, didInsert, etc.
- Always call didInsert, even with INSERT OR IGNORE
- Explicit conflict resolution in persistence methods
- Add ...AndFetch... methods
2022-08-21 21:22:34 +02:00
Gwendal Roué 2f2cccacf9 Remove UI tests of demo apps, since GRDBQuery is tested on its own
(Don't test the framework)
2022-08-21 21:22:34 +02:00
Gwendal Roué e5d10ed8c1 fix async AppDatabaseTests tests 2022-08-21 21:22:34 +02:00
Gwendal Roué 7ffc332327 BREAKING: replace selectID() with selectPrimaryKey(as:)
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??.

Instead, we introduce selectPrimaryKey(as:), which allows the user to provide the desired type.

    Player.selectPrimaryKey(as: Int64.self) // QueryInterface<Int64>
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é c0c6b34869 SE-0346: primary associated types 2022-08-21 21:22:34 +02:00
Gwendal Roué 458e1e2675 BREAKING: throwing DatabaseQueue() initializer
As a consequence, FTS3.tokenize(_:) is a throwing method as well.
2022-08-21 21:22:33 +02:00
Gwendal Roué 86de843bda Swift 5.7 required: Xcode 14 updates 2022-08-21 19:21:57 +02:00
Gwendal Roué 811c41af6d @Query has been exported to https://github.com/groue/GRDBQuery 2021-11-25 15:25:40 +01:00
Gwendal Roué 6b02b4ca02 Rename Query generic parameter to Request 2021-11-25 09:37:40 +01:00
Gwendal Roué 62e710b9b1 Cleanup Query demo app 2021-11-24 19:16:39 +01:00
Gwendal Roué d85168dd3c Query cleanup 2021-11-07 13:47:04 +01:00
Gwendal Roué 7ed103d5e4 Documentation 2021-11-07 13:25:50 +01:00
Gwendal Roué b44a9eb470 Extract @Query into its own package 2021-11-07 12:03:55 +01:00
Gwendal Roué 65668cfc8e Documentation 2021-11-06 11:22:16 +01:00
Gwendal Roué 0317c4e454 Reuse screenshot of Combine demo 2021-10-31 06:06:55 +01:00
Gwendal Roué c755dc70ef Restrict async/await to Xcode 13.1+ 2021-10-30 20:09:39 +02:00
Gwendal Roué 3c78029b3c SwiftUI demo apps: PlayerEditionView saves player when back button is pressed 2021-10-25 19:07:40 +02:00
Gwendal Roué dbb19979d6 Demo app: prefer tracking over trackingConstantRegion
For those specific player requests, trackingConstantRegion is _correct_. But readers may blindly copy and paste, and use trackingConstantRegion when they should not.

So the demo apps prefer the unoptimized but always-correct `tracking` method instead.
2021-10-19 08:57:45 +02:00
Gwendal Roué 0d8d40d683 Demo apps: document why we use .immediate observation scheduling 2021-10-19 08:55:41 +02:00
Gwendal Roué 5d69d2a35b All demo apps provide unbounded read-only access to the database
Also, UIKit app now does not have to deal with an initial asynchronous delivery of players
2021-10-19 08:54:48 +02:00
Gwendal Roué 128399871a Demo projects organization 2021-10-19 08:15:14 +02:00
Gwendal Roué 4dd5677755 Demo apps: rename newRandom to makeRandom 2021-10-19 08:03:56 +02:00
Gwendal Roué dbf3335188 Demo apps: prefer inserted(_:) over mutating a temp variable 2021-10-19 08:02:09 +02:00
Gwendal Roué 048082f4b2 Demo apps: prefer isEmpty(db) over fetchCount(db) == 0 2021-10-19 07:58:03 +02:00
Gwendal Roué 6a980f90da Async sequence is unsuitable for preventing flash of missing content
See https://forums.swift.org/t/52862 for a longer explanation.

Fortunately, we can base @Query on Combine publishers, which do not have this problem.
2021-10-18 08:41:44 +02:00
Gwendal Roué e4bfea8bcc Use inserted(_:) in order to avoid a temporary variable 2021-10-17 21:25:19 +02:00
Gwendal Roué 329a7c8301 @Query cleanup & documentation 2021-10-17 14:09:53 +02:00
Gwendal Roué 1ff5159d40 Add the MIT license to Query.swift
This file is designed to be copied into user apps: make sure the license comes along.
2021-10-17 13:38:28 +02:00
Gwendal Roué 01d2bc89a9 Cleanup async demo app 2021-10-17 13:26:42 +02:00
Gwendal Roué 6bcee422b7 Improve tests of async demo app 2021-10-17 13:26:42 +02:00
Gwendal Roué 07faea9cfe Restore demo app tests 2021-10-17 13:26:42 +02:00
Gwendal Roué b76950f695 Follow EnvironmentValues.managedObjectContext example: appDatabase is not optional 2021-10-17 13:26:42 +02:00
Gwendal Roué b9e79791a3 Modernize syntax 2021-10-17 13:26:42 +02:00
Gwendal Roué 533cef692f Use SwiftUI Label 2021-10-17 13:26:42 +02:00
Gwendal Roué 0bed585fd0 Use dismiss from SwiftUI environment 2021-10-17 13:26:42 +02:00