Commit Graph
705 Commits
Author SHA1 Message Date
Gwendal Roué ea7ebe1ff5 Fix failing test for #1390 2023-06-11 13:15:55 +02:00
Gwendal Roué 266efa041c Expose FetchableRecordDecoder 2023-04-29 17:15:54 +02:00
Gwendal Roué 840fa3b5da RecordError DocC 2023-03-12 18:14:38 +01:00
Gwendal Roué 8cd71ac832 Fix TableRecord.databaseSelection sample code 2023-03-12 17:18:28 +01:00
Gwendal Roué 3382280cc3 Statement.execute(arguments:) uses temporary bindings
Inspired by @helje5 in https://hachyderm.io/@helge@mastodon.social/109978514220902036

Thank you!!

Now, onto cursors!
2023-03-11 12:10:25 +01:00
Gwendal Roué b3763ad08e RecordCursor: same documation as all cursors 2023-02-26 10:26:03 +01:00
Gwendal Roué 5ed44b94bc More improvements to RecordTimestamps.md 2023-02-23 07:59:08 +01:00
Gwendal Roué 734d911416 Fix typo 2023-02-22 06:18:13 +01:00
Gwendal Roué b0d73f3126 EncodableRecord.databaseChanges(modify:) 2023-02-21 22:48:37 +01:00
Gwendal Roué 3b0cf1fb0b FTS5 DocC 2023-02-19 17:38:19 +01:00
Gwendal Roué aff924a72b Upgrade Swiftlint and fix warnings 2023-02-04 11:23:14 +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
baegteun a9feac1339 ♻️ :: OSX -> macOS in Availability Check 2023-01-17 13:58:37 +09:00
Gwendal Roué 5ab7bfb229 recordNotFound returns an error instead of Never
https://forums.swift.org/t/methods-that-throw-and-return-never/61715
2022-11-30 21:33:15 +01:00
Gwendal Roué 4a4ff9950c FetchableRecord.find() methods 2022-11-30 19:36:25 +01:00
Gwendal Roué afc578db7f TableRecord.recordNotFound() methods 2022-11-30 19:36:08 +01:00
Gwendal Roué df3bd46346 Rename PersistenceError to RecordError 2022-11-30 19:11:07 +01:00
Gwendal Roué 4e4699ebed Improve inline documentation 2022-11-26 16:26:46 +01:00
Gwendal Roué 3014ddb00a Enhance Documentation 2022-11-09 21:52:22 +01:00
Gwendal Roué 71880a9b8e Enhance Documentation 2022-11-09 13:20:08 +01:00
Gwendal Roué 4307f6a680 Fix Swiftlint warnings 2022-11-06 18:43:00 +01:00
Gwendal Roué 13c804d1cc DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 811d287bd9 Row.withUnsafeData 2022-11-06 16:02:36 +01:00
Gwendal Roué 1818534513 DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 9531a7f8fc More specialization 2022-09-17 15:49:28 +02: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é c2e4aaf51d Throw SQLITE_MISUSE in case of programmer error in the aroundXxx callbacks
While writing SingletonRecordTest.swift, I tried the solution below, in order to turn a failed update into an insert:

    func aroundUpdate(_ db: Database, columns: Set<String>, update: () throws -> PersistenceSuccess) throws {
        do {
            _ = try update()
        } catch {
            insert(db)
        }
    }

But this can't work. This `insert(db)` is unable to provide the information we need in `update()`: the result of the eventual RETURNING clause, and the PersistenceSuccess that contains the persisted PersistenceContainer.

So we now detect two misuses: 1) not calling the action method, and 2) not rethrowing the error of the action method.
2022-08-25 19:05:27 +02:00
Gwendal Roué 327911d057 Upsert: add support for conflict target and assignments 2022-08-23 20:02:17 +02:00
Gwendal Roué 2a5626efea Replace if let x = x with if let x 2022-08-22 20:40:00 +02:00
Gwendal Roué 2789444acd Enable UPSERT and RETURNING with SQLCipher 2022-08-21 21:22:34 +02:00
Gwendal Roué 37f0a0bb9a BREAKING: throwing EncodableRecord.encode(to:) 2022-08-21 21:22:34 +02:00
Gwendal Roué 8f562d3e11 NEW: Upsert 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é 0ed9367b26 BREAKING: DatabaseCursor no longer exposes its prepared statement 2022-08-21 21:22:34 +02:00
Gwendal Roué 5243db7fbc Spelling 2022-08-21 21:22:34 +02:00
Gwendal Roué e0786537db BREAKING: replace Int32 with CInt everywhere it is possible 2022-08-21 21:22:34 +02:00
Gwendal Roué 895964de16 BREAKING: Throwing FetchableRecord.init(row:) 2022-08-21 21:22:34 +02:00
Gwendal Roué a15f731042 BREAKING: remove Record.copy()
This will allow FetchableRecord.init(row:) to throw
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é dd55175978 SE-0345: if let x { }
https://github.com/apple/swift-evolution/blob/main/proposals/0345-if-let-shorthand.md
2022-08-21 21:22:34 +02:00
Gwendal Roué 58293befc9 BREAKING: Optional is a database value like others 2022-08-21 21:22:34 +02:00
Gwendal Roué fe225fe452 BREAKING: Remove deprecated methods 2022-08-21 19:21:57 +02:00
Gwendal Roué 23cbf13af0 Swift 5.7 required: Availability checks 2022-08-21 19:21:57 +02:00
Gwendal Roué fcb037bdf0 Swift 5.7 required: Bump deployment targets 2022-08-21 19:21:57 +02:00
Gwendal Roué f0cfde682e Update outdated documentation 2022-05-18 08:12:00 +02:00
Gwendal Roué c30b49117b If a scope is found, there is no point searching for prefetched rows 2022-03-04 12:04:02 +01:00
Gwendal Roué ec975819b7 Fix for container.decodeNil(forKey:) in the context of including(all:) 2022-03-04 11:55:53 +01:00
Gwendal Roué 09922c34ff Code formatting 2022-01-23 12:24:34 +01:00
BB9z 6d3f309cad Fix typos 2022-01-19 00:10:42 +08:00