Commit Graph
854 Commits
Author SHA1 Message Date
Gwendal Roué 60beb7cd9c DocC: document extensions 2023-06-17 17:03:55 +02:00
Gwendal Roué c3664e2b16 Fix Xcode 15 DocC warnings 2023-06-06 08:15:02 +02:00
Gwendal Roué 4a5d4d6e49 Fix Xcode 15 warnings 2023-06-06 08:06:06 +02:00
Gwendal Roué 84ac401886 Add FilteredRequest.all()
This method does nothing: it returns `self`. It exists in order to match `none()`.
2023-06-02 13:31:02 +02:00
Gwendal Roué c02139c045 Default name for newly created indexes 2023-05-25 09:03:09 +02:00
Gwendal Roué 82d28b3167 Bitwise assignment operators &= |= <<= >>= 2023-05-23 08:16:14 +02:00
Gwendal Roué 717c2836ec Bitwise operators & | ~ << >> 2023-05-23 08:15:04 +02:00
Gwendal Roué 4ff057ac3b Deprecate table constraints built from SQLExpressible - prefer SQLSpecificExpressible instead
Fixes #1371
2023-05-15 12:45:33 +02:00
Gwendal Roué 77d8a46039 Remove obsolete TODOs 2023-04-08 12:30:55 +02:00
Gwendal Roué b81e858ca0 Better fix for #1357
Previous fix would not correctly address #1357 when invalid double-quoted identifiers are interpreted as string literals (Configuration.acceptsDoubleQuotedStringLiterals = true, or SQLCipher 3)
2023-04-01 14:59:42 +02:00
Gwendal Roué 373fe467d6 Fix failing test for #1357 2023-04-01 14:09:50 +02:00
Gwendal Roué 29b5b99b89 Fix typos 2023-03-11 08:00:23 +01:00
Gwendal Roué 3b0cf1fb0b FTS5 DocC 2023-02-19 17:38:19 +01:00
Gwendal Roué 17906dc505 Table SQL interpolation
Addresses https://github.com/groue/GRDB.swift/issues/1332
2023-02-14 08:58:26 +01:00
Gwendal Roué 302fc69f3a TableDefinition.primaryKey(["a", "b"]) is no longer sunsetted
People need it to define the primary key on non-consecutive columns: https://github.com/groue/GRDB.swift/discussions/1326
2023-02-10 08:11:02 +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é 2976e81a95 Fix failing test for #1315 2023-01-15 13:39:05 +01:00
Gwendal Roué 3794e7e801 DatabasePromise.description 2023-01-14 12:21:08 +01:00
Gwendal Roué 119f226610 DocC: GeneratedColumnQualification 2022-12-12 08:42:18 +01:00
Gwendal Roué 05da03ab1a Expose generated columns with availability checks 2022-12-10 11:32:23 +01:00
Gwendal Roué 7bd1992e61 Fix ergonomics issue with the definition of compound primary key
If the user would forget the PrimaryKeyDefinition, the primary was not defined:

try db.create(table: "membership") { t in
    // WRONG: pk is unused
    t.primaryKey { pk in
        t.column("playerId", .integer)
        t.column("teamId", .text)
    }
}

The fix is to remove the PrimaryKeyDefinition:

try db.create(table: "membership") { t in
    t.primaryKey {
        t.column("playerId", .integer)
        t.column("teamId", .text)
    }
}
2022-11-27 14:09:25 +01:00
Gwendal Roué f8728bbed8 Enhance documentation 2022-11-27 13:01:42 +01:00
Gwendal Roué f5ebf0de4d Use primary key definitions with NOT NULL constraint by default 2022-11-27 12:35:47 +01:00
Gwendal Roué cd16e921fe Tests for primary key definition with NOT NULL constraint by default 2022-11-27 11:47:56 +01:00
Gwendal Roué 8b8e480391 Primary key definition with NOT NULL constraint by default 2022-11-27 11:32:38 +01:00
Gwendal Roué 3074b61cb7 Move schema documentation to DocC 2022-11-27 11:07:13 +01:00
Gwendal Roué 4e4699ebed Improve inline documentation 2022-11-26 16:26:46 +01:00
Gwendal Roué b14ef2112c Fix documentation typo 2022-11-11 12:55:35 +01:00
Gwendal Roué 0b12e89e62 DocC: AssociationAggregate 2022-11-06 17:18:27 +01:00
Gwendal Roué 13c804d1cc DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 1818534513 DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué a89dad2554 Fix Swiftlint warnings 2022-10-29 14:21:33 +02:00
Gwendal Roué 2ade133b50 Move availability check below doc comment 2022-10-20 08:27:46 +02:00
Josip Cavar c57e76be52 Add support for .strict table option in 3.37+ 2022-10-19 15:55:46 +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é b0f7493765 BREAKING: rename request methods that build a DatabasePromise
This creates an opportunity for future `request.filter { ... }` apis that look like standard ones. Why not `Player.filter { $0.score > 1000 }` eventually, perhaps with code generation?
2022-09-06 22:56:40 +02:00
Gwendal Roué fdbcb07452 Fix #1275 2022-09-06 08:25:21 +02:00
Gwendal Roué 58f970701f BREAKING: Fix failing test for #1267
The regression was probably due to a bad interaction between Implicitly Opened Existentials (SE-0352) and Opaque Parameter Declarations (SE-0341) which GRDB 6 now uses in a lot of places.

Considering the sample code below:

    try db.create(table: ...) { t in
      t.column(...).check { $0 != Column(...) }
    }

- The `check` method accepts a closure that returns `any SQLExpressible` (the same as GRDB 5)
- The `!=` SQL comparison operator is `(some SQLSpecificExpressible, some SQLSpecificExpressible) -> SQLExpression`, when it was `(SQLSpecificExpressible, SQLSpecificExpressible) -> SQLExpression` in GRDB 5

The compiler has started preferring interpreting the != operator as Column's Equatable implementation, instead of the `!=` SQL comparison operator

We force the compiler to use the SQL comparison operator by removing the Equatable conformance from Column. It was introduced in a70b42c, as a support for a feature that has been removed since then.

This is a breaking change, but this also is an improvement. Now `column1 != column2` has a single meaning, and the library is less prone to similar regressions in the future.
2022-08-25 08:26:37 +02:00
Gwendal Roué c6657b7063 ColumnAssignment that does nothing
A cool upsert feature is to overwrite an existing value in case of conflict, but another cool upsert feature is to NOT overwrite an existing value. This commit makes it possible to create a ColumnAssignement that does nothing.
2022-08-23 20:02:17 +02:00
Gwendal Roué 2789444acd Enable UPSERT and RETURNING with SQLCipher 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é c553d2d69e Documentation 2022-08-21 21:22:34 +02:00
Gwendal Roué 5243db7fbc Spelling 2022-08-21 21:22:34 +02:00
Gwendal Roué 4ced8c78e7 Less "iff" (some people think this is a typo)
iff = if and only if
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
Gwendal Roué 1239c14e6d Explicit initializers for HasOneThrough and HasManyThrough associations 2022-08-21 21:22:34 +02:00
Gwendal Roué c86581dedc Make SQLQueryGenerator.swift easier to read 2022-08-21 21:22:34 +02:00