From 8af33c4fc9acd18b12d071519b15126955824e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 19 Aug 2018 12:25:27 +0200 Subject: [PATCH 1/6] Introduce select(..., as:) Record.select(..., as: Value.self) is equivalent to Record.select(...).asRequest(of: Value.self). It somewhat improves the readability of some requests: Player.select(max(Column("score")), as: Int.self) --- .../Association/Association.swift | 2 +- .../QueryInterfaceRequest.swift | 74 ++++++++++++++++++- GRDB/QueryInterface/RequestProtocols.swift | 6 +- 3 files changed, 77 insertions(+), 5 deletions(-) diff --git a/GRDB/QueryInterface/Association/Association.swift b/GRDB/QueryInterface/Association/Association.swift index 212fe3452..5d4e72dcf 100644 --- a/GRDB/QueryInterface/Association/Association.swift +++ b/GRDB/QueryInterface/Association/Association.swift @@ -59,7 +59,7 @@ public protocol Association: DerivableRequest { } extension Association { - /// Creates an association with a new set of selected columns. + /// Creates an association which selects *selection*. /// /// struct Player: TableRecord { /// static let team = belongsTo(Team.self) diff --git a/GRDB/QueryInterface/QueryInterfaceRequest.swift b/GRDB/QueryInterface/QueryInterfaceRequest.swift index bf08c5157..11088d4f8 100644 --- a/GRDB/QueryInterface/QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/QueryInterfaceRequest.swift @@ -47,7 +47,7 @@ extension QueryInterfaceRequest : DerivableRequest, AggregatingRequest { // MARK: Request Derivation - /// Creates a request with a new set of selected columns. + /// Creates a request which selects *selection*. /// /// // SELECT id, email FROM player /// var request = Player.all() @@ -63,6 +63,42 @@ extension QueryInterfaceRequest : DerivableRequest, AggregatingRequest { return QueryInterfaceRequest(query: query.select(selection)) } + /// Creates a request which selects *selection*, and fetches values of + /// type *type*. + /// + /// try dbQueue.read { db in + /// // SELECT max(score) FROM player + /// let request = Player.all().select([max(Column("score"))], as: Int.self) + /// let maxScore: Int? = try request.fetchOne(db) + /// } + public func select(_ selection: [SQLSelectable], as type: RowDecoder.Type) -> QueryInterfaceRequest { + return QueryInterfaceRequest(query: query.select(selection)) + } + + /// Creates a request which selects *selection*, and fetches values of + /// type *type*. + /// + /// try dbQueue.read { db in + /// // SELECT max(score) FROM player + /// let request = Player.all().select(max(Column("score")), as: Int.self) + /// let maxScore: Int? = try request.fetchOne(db) + /// } + public func select(_ selection: SQLSelectable..., as type: RowDecoder.Type) -> QueryInterfaceRequest { + return select(selection, as: type) + } + + /// Creates a request which selects *sql*, and fetches values of + /// type *type*. + /// + /// try dbQueue.read { db in + /// // SELECT max(score) FROM player + /// let request = Player.all().select(sql: "max(score)", as: Int.self) + /// let maxScore: Int? = try request.fetchOne(db) + /// } + public func select(sql: String, arguments: StatementArguments? = nil, as type: RowDecoder.Type) -> QueryInterfaceRequest { + return select(SQLSelectionLiteral(sql, arguments: arguments), as: type) + } + /// Creates a request which returns distinct rows. /// /// // SELECT DISTINCT * FROM player @@ -256,6 +292,42 @@ extension TableRecord { return all().select(sql: sql, arguments: arguments) } + /// Creates a request which selects *selection*, and fetches values of + /// type *type*. + /// + /// try dbQueue.read { db in + /// // SELECT max(score) FROM player + /// let request = Player.select([max(Column("score"))], as: Int.self) + /// let maxScore: Int? = try request.fetchOne(db) + /// } + public static func select(_ selection: [SQLSelectable], as type: RowDecoder.Type) -> QueryInterfaceRequest { + return all().select(selection, as: type) + } + + /// Creates a request which selects *selection*, and fetches values of + /// type *type*. + /// + /// try dbQueue.read { db in + /// // SELECT max(score) FROM player + /// let request = Player.select(max(Column("score")), as: Int.self) + /// let maxScore: Int? = try request.fetchOne(db) + /// } + public static func select(_ selection: SQLSelectable..., as type: RowDecoder.Type) -> QueryInterfaceRequest { + return all().select(selection, as: type) + } + + /// Creates a request which selects *sql*, and fetches values of + /// type *type*. + /// + /// try dbQueue.read { db in + /// // SELECT max(score) FROM player + /// let request = Player.select(sql: "max(score)", as: Int.self) + /// let maxScore: Int? = try request.fetchOne(db) + /// } + public static func select(sql: String, arguments: StatementArguments? = nil, as type: RowDecoder.Type) -> QueryInterfaceRequest { + return all().select(sql: sql, arguments: arguments, as: type) + } + /// Creates a request with the provided *predicate*. /// /// // SELECT * FROM player WHERE email = 'arthur@example.com' diff --git a/GRDB/QueryInterface/RequestProtocols.swift b/GRDB/QueryInterface/RequestProtocols.swift index 9182a9eb7..6c4dae0e0 100644 --- a/GRDB/QueryInterface/RequestProtocols.swift +++ b/GRDB/QueryInterface/RequestProtocols.swift @@ -2,7 +2,7 @@ /// The protocol for all requests that can refine their selection. public protocol SelectionRequest { - /// Creates a request with a new set of selected columns. + /// Creates a request which selects *selection*. /// /// // SELECT id, email FROM player /// var request = Player.all() @@ -18,7 +18,7 @@ public protocol SelectionRequest { } extension SelectionRequest { - /// Creates a request with a new set of selected columns. + /// Creates a request which selects *selection*. /// /// // SELECT id, email FROM player /// var request = Player.all() @@ -34,7 +34,7 @@ extension SelectionRequest { return select(selection) } - /// Creates a request with a new set of selected columns. + /// Creates a request which selects *sql*. /// /// // SELECT id, email FROM player /// var request = Player.all() From da60a5004e11bfe6a929a7a48ac02a55c52208a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 19 Aug 2018 12:30:02 +0200 Subject: [PATCH 2/6] Tests for select(..., as:) --- .../QueryInterfaceRequestTests.swift | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/Tests/GRDBTests/QueryInterfaceRequestTests.swift b/Tests/GRDBTests/QueryInterfaceRequestTests.swift index 8b28d4046..ea9814bbd 100644 --- a/Tests/GRDBTests/QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/QueryInterfaceRequestTests.swift @@ -220,6 +220,123 @@ class QueryInterfaceRequestTests: GRDBTestCase { "SELECT \"name\" FROM \"readers\"") } + func testSelectAs() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO readers (name, age) VALUES (?, ?)", arguments: ["Arthur", 42]) + + // select(..., as: String.self) + do { + // Type.select(..., as:) + do { + // variadic + do { + let value = try Reader + .select(Col.name, as: String.self) + .fetchOne(db)! + XCTAssertEqual(value, "Arthur") + } + // array + do { + let value = try Reader + .select([Col.name], as: String.self) + .fetchOne(db)! + XCTAssertEqual(value, "Arthur") + } + // raw sql without argument + do { + let value = try Reader + .select(sql: "name", as: String.self) + .fetchOne(db)! + XCTAssertEqual(value, "Arthur") + } + } + // request.select(..., as:) + do { + // variadic + do { + let value = try Reader + .all() + .select(Col.name, as: String.self) + .fetchOne(db)! + XCTAssertEqual(value, "Arthur") + } + // array + do { + let value = try Reader + .all() + .select([Col.name], as: String.self) + .fetchOne(db)! + XCTAssertEqual(value, "Arthur") + } + // raw sql without argument + do { + let value = try Reader + .all() + .select(sql: "name", as: String.self) + .fetchOne(db)! + XCTAssertEqual(value, "Arthur") + } + } + } + + // select(..., as: Row.self) + do { + // Type.select(..., as:) + do { + // variadic + do { + let value = try Reader + .select(Col.name, Col.age, as: Row.self) + .fetchOne(db)! + XCTAssertEqual(value, ["name": "Arthur", "age": 42]) + } + // array + do { + let value = try Reader + .select([Col.name, Col.age], as: Row.self) + .fetchOne(db)! + XCTAssertEqual(value, ["name": "Arthur", "age": 42]) + } + // raw sql with named argument + do { + let value = try Reader + .select(sql: "name, :age AS age", arguments: ["age": 22], as: Row.self) + .fetchOne(db)! + XCTAssertEqual(value, ["name": "Arthur", "age": 22]) + } + } + // request.select(..., as:) + do { + // variadic + do { + let value = try Reader + .all() + .select(Col.name, Col.age, as: Row.self) + .fetchOne(db)! + XCTAssertEqual(value, ["name": "Arthur", "age": 42]) + } + // array + do { + let value = try Reader + .all() + .select([Col.name, Col.age], as: Row.self) + .fetchOne(db)! + XCTAssertEqual(value, ["name": "Arthur", "age": 42]) + } + // raw sql with positional argument + do { + let value = try Reader + .all() + .select(sql: "name, ? AS age", arguments: [22], as: Row.self) + .fetchOne(db)! + XCTAssertEqual(value, ["name": "Arthur", "age": 22]) + } + } + } + } + } + // MARK: - Distinct From 7bb0718baee78870354e092553e645c2cac3819e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 19 Aug 2018 13:02:45 +0200 Subject: [PATCH 3/6] Documentation for select(..., as:) --- README.md | 120 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 87 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index fef8fb679..2e544bea1 100644 --- a/README.md +++ b/README.md @@ -1810,7 +1810,8 @@ SQLite has the opportunity to perform additional optimizations when aggregates a ```swift // SELECT maxLength("name") FROM player -Int.fetchOne(db, Player.select(maxLength.apply(nameColumn))) // Int? +let request = Player.select(maxLength.apply(nameColumn)) +try Int.fetchOne(db, request) // Int? ``` @@ -2622,7 +2623,7 @@ struct Player: Codable, FetchableRecord, PersistableRecord { } static var maximumScore: QueryInterfaceRequest { - return select(max(CodingKeys.score)).asRequest(of: Int.self) + return select(max(CodingKeys.score), as: Int.self) } } @@ -3425,7 +3426,7 @@ So don't miss the [SQL API](#sqlite-api). - [Expressions](#expressions) - [SQL Operators](#sql-operators) - [SQL Functions](#sql-functions) -- [Fetching from Requests](#fetching-from-requests) +- [Fetching from Requests] - [Fetching by Key](#fetching-by-key) - [Fetching Aggregated Values](#fetching-aggregated-values) - [Delete Requests](#delete-requests) @@ -3478,7 +3479,7 @@ try db.create(table: "example", temporary: true, ifNotExists: true) { t in > :bulb: **Tip**: database table names should be singular, and camel-cased. Make them look like Swift identifiers: `place`, `country`, `postalAddress`, 'httpRequest'. > -> This will help you using [Associations](Documentation/AssociationsBasics.md) when you need them. Database table names that follow another naming convention are totally OK, but you will need to perform extra configuration. +> This will help you using [Associations] when you need them. Database table names that follow another naming convention are totally OK, but you will need to perform extra configuration. **Add regular columns** with their name and eventual type (text, integer, double, numeric, boolean, blob, date and datetime) - see [SQLite data types](https://www.sqlite.org/datatype3.html): @@ -3653,13 +3654,18 @@ You can now build requests with the following methods: `all`, `none`, `select`, The hidden `rowid` column can be selected as well [when you need it](#the-implicit-rowid-primary-key). -- `select(...)` defines the selected columns. See [Columns Selected by a Request]. +- `select(...)` and `select(..., as:)` defines the selected columns. See [Columns Selected by a Request]. + + ```swift + // SELECT name FROM player + Player.select(nameColumn, as: String.self) + ``` - `distinct()` performs uniquing. ```swift // SELECT DISTINCT name FROM player - Player.select(nameColumn).distinct() + Player.select(nameColumn, as: String.self).distinct() ``` - `filter(expression)` applies conditions. @@ -3814,17 +3820,14 @@ let request = Player.all() **The selection can be changed for each individual requests, or for all requests built from a given type.** -To specify the selection of a specific request, use the `select` method: +When the selection of a particular request does not fit the origin record, use the `select(...)` or `select(..., as:)` method (see [Fetching from Requests] for detailed information): ```swift -// SELECT id, name FROM player -let request = Player.select(Column("id"), Column("name")) - -// SELECT *, rowid FROM player -let request = Player.select(AllColumns(), Column.rowID) +let request = Player.select(max(Column("score"))) +let maxScore: Int? = try Int.fetchOne(db, request) ``` -To specify the default selection for all requests built from a type, define the `databaseSelection` property: +To specify the default selection for a record type, define the `databaseSelection` property: ```swift struct RestrictedPlayer : TableRecord { @@ -4040,7 +4043,7 @@ Feed [requests](#requests) with SQL expressions built from your Swift code: Player.select(f.apply(nameColumn)) ``` - + ## Fetching from Requests Once you have a request, you can fetch the records at the origin of the request: @@ -4055,8 +4058,6 @@ try request.fetchAll(db) // [Player] try request.fetchOne(db) // Player? ``` -See [fetching methods](#fetching-methods) for information about the `fetchCursor`, `fetchAll` and `fetchOne` methods. - For example: ```swift @@ -4064,29 +4065,71 @@ let allPlayers = try Player.fetchAll(db) // [Player] let arthur = try Player.filter(nameColumn == "Arthur").fetchOne(db) // Player? ``` +See [fetching methods](#fetching-methods) for information about the `fetchCursor`, `fetchAll` and `fetchOne` methods. -**When the selected columns don't fit the source type**, change your target: any other type that adopts the [FetchableRecord] protocol, plain [database rows](#fetching-rows), and even [values](#values): +**You sometimes want to fetch other values**. + +The simplest way is to use the request as an argument to a fetching method of the desired type: ```swift +// Fetch an Int let request = Player.select(max(scoreColumn)) let maxScore = try Int.fetchOne(db, request) // Int? +// Fetch a Row let request = Player.select(min(scoreColumn), max(scoreColumn)) let row = try Row.fetchOne(db, request)! // Row let minScore = row[0] as Int? let maxScore = row[1] as Int? ``` -You may also use the `asRequest(of:)` method, which lets you alter the type of the request itself, and feed database observation tools like [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): +When you also want to use database observation tools such as [FetchedRecordsController](#fetchedrecordscontroller) or [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB), you have to go one step further, and change the type of the request: -```swift -let request = Player.select(max(scoreColumn)).asRequest(of: Int.self) -request.rx - .fetchOne(in: dbQueue) - .subscribe(onNext: { maxScore: Int? in - print("Maximum score has changed") - }) -``` +- When you change the selection, prefer the `select(..., as:)` method: + + ```swift + // A request of Int + let request = Player.select(max(scoreColumn), as: Int.self) + + // Simple fetch + let maxScore = try dbQueue.read { db in + try request.fetchOne(db) // Int? + } + + // Observe with RxGRDB + request.rx + .fetchOne(in: dbQueue) + .subscribe(onNext: { maxScore: Int? in + print("The maximum score has changed") + }) + ``` + +- Otherwise, use `asRequest(of:)`. Here is an example that uses [Associations]: + + ```swift + struct BookInfo: FetchableRecord, Decodable { + var book: Book + var author: Author + } + + // A request of BookInfo + let request = Book + .including(required: Book.author) + .asRequest(of: BookInfo.self) + + // Simple fetch + let bookInfos = try dbQueue.read { db in + try request.fetchAll(db) // [BookInfo] + } + + // Observe with FetchedRecordsController + let controller = FetchedRecordsController( + dbQueue, + request: request, + isSameRecord: { (bookInfo1, bookInfo2) in + bookInfo1.book.id == bookInfo2.book.id + }) + ``` ## Fetching By Key @@ -4342,13 +4385,20 @@ let request = Player.all() try Player.filter(color: .red).fetchAll(db) ``` -- The `asRequest(of:)` method changes the type fetched by the request: +- The `asRequest(of:)` method changes the type fetched by the request. It is useful, for example, when you use [Associations]: ```swift - // Int? - let maxScore = Player.select(max(Column("score"))) - .asRequest(of: Int.self) - .fetchOne(db) + struct BookInfo: FetchableRecord, Decodable { + var book: Book + var author: Author + } + + let request = Book + .including(required: Book.author) + .asRequest(of: BookInfo.self) + + // [BookInfo] + try request.fetchAll(db) ``` - The `adapted(_:)` method eases the consumption of complex rows with [row adapters](#row-adapters). See [Joined Queries Support](#joined-queries-support) for some sample code that uses this method. @@ -5191,7 +5241,7 @@ LEFT JOIN round ON ... GROUP BY ... ``` -We will not talk about *generating* joined queries, which is covered in [Associations](Documentation/AssociationsBasics.md). +We will not talk about the *generation* of joined queries, which is covered in [Associations]. **So what are we talking about?** @@ -6652,7 +6702,7 @@ try String.fetchOne(db, "SELECT \(uppercased.name)('Jérôme')") Those unicode-aware string functions are also readily available in the [query interface](#sql-functions): -``` +```swift Player.select(nameColumn.uppercased) ``` @@ -7240,6 +7290,8 @@ try Player.select(idColumn, nameColumn).fetchAll(db) If your Player type can't be built without other columns (it has non-optional properties for other columns), *do define and use a different type*. +See [Columns Selected by a Request] for more information. + **Don't fetch rows you don't use** @@ -7583,10 +7635,12 @@ This protocol has been renamed [TableRecord] in GRDB 3.0. This chapter has been renamed [Beyond FetchableRecord]. +[Associations]: Documentation/AssociationsBasics.md [Beyond FetchableRecord]: #beyond-fetchablerecord [Columns Selected by a Request]: #columns-selected-by-a-request [Conflict Resolution]: #conflict-resolution [Customizing the Persistence Methods]: #customizing-the-persistence-methods +[Fetching from Requests]: #fetching-from-requests [The Implicit RowID Primary Key]: #the-implicit-rowid-primary-key [The userInfo Dictionary]: #the-userinfo-dictionary [JSON Columns]: #json-columns From 9815b310b65371fdd7cf47f2611902e1645a3d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 19 Aug 2018 13:03:00 +0200 Subject: [PATCH 4/6] TODO.md --- TODO.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 85a06d150..d5fdfbedd 100644 --- a/TODO.md +++ b/TODO.md @@ -40,7 +40,13 @@ // new request.select(Column("name"), as: String.self) ``` - +- [ ] select values from a JSON column: + + ```swift + let nesteds = try Record + .select(Column("nested"), as: Nested.self) + .fetchAll(db) + ``` Swift 4.2 From 982dee5b77769cfc77be33b57a683537d4118152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 19 Aug 2018 13:31:48 +0200 Subject: [PATCH 5/6] Documentation improvements --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2e544bea1..40275a384 100644 --- a/README.md +++ b/README.md @@ -3654,7 +3654,7 @@ You can now build requests with the following methods: `all`, `none`, `select`, The hidden `rowid` column can be selected as well [when you need it](#the-implicit-rowid-primary-key). -- `select(...)` and `select(..., as:)` defines the selected columns. See [Columns Selected by a Request]. +- `select(...)` and `select(..., as:)` define the selected columns. See [Columns Selected by a Request]. ```swift // SELECT name FROM player @@ -3820,14 +3820,14 @@ let request = Player.all() **The selection can be changed for each individual requests, or for all requests built from a given type.** -When the selection of a particular request does not fit the origin record, use the `select(...)` or `select(..., as:)` method (see [Fetching from Requests] for detailed information): +The `select(...)` and `select(..., as:)` methods change the selection of a single request (see [Fetching from Requests] for detailed information): ```swift let request = Player.select(max(Column("score"))) let maxScore: Int? = try Int.fetchOne(db, request) ``` -To specify the default selection for a record type, define the `databaseSelection` property: +The default selection for a record type is controlled by the `databaseSelection` property: ```swift struct RestrictedPlayer : TableRecord { From e1f80494a84a00902575e2b54cebf4c6808288f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 19 Aug 2018 13:52:42 +0200 Subject: [PATCH 6/6] CHANGELOG.md --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cca487f80..ec588d903 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,9 @@ Release Notes ### New -- [#397](https://github.com/groue/GRDB.swift/pull/397): JSON encoding and decoding of codable record properties -- [#399](https://github.com/groue/GRDB.swift/pull/399): Codable support: customize the `userInfo` context dictionary, and the format of JSON columns +- [#397](https://github.com/groue/GRDB.swift/pull/397): Codable records: JSON encoding and decoding of codable record properties +- [#399](https://github.com/groue/GRDB.swift/pull/399): Codable records: customize the `userInfo` context dictionary, and the format of JSON columns +- [#401](https://github.com/groue/GRDB.swift/pull/401): Query Interface: set the selection and the fetched type in a single method call - [#393](https://github.com/groue/GRDB.swift/pull/393): Upgrade SQLCipher to 3.4.2, enable FTS5 on GRDBCipher and new pod GRDBPlus. - [#384](https://github.com/groue/GRDB.swift/pull/384): Improve database value decoding diagnostics - Cursors of optimized values (Strint, Int, Date, etc.) have been renamed: FastDatabaseValueCursor and FastNullableDatabaseValueCursor replace the deprecated ColumnCursor and NullableColumnCursor. @@ -19,6 +20,8 @@ Release Notes ### API diff +Fixes: + ```diff class DatabaseQueue { - func write(_ block: (Database) throws -> T) rethrows -> T { @@ -26,7 +29,11 @@ Release Notes - func unsafeReentrantRead(_ block: (Database) throws -> T) throws -> T { + func unsafeReentrantRead(_ block: (Database) throws -> T) rethrows -> T { } +``` +Enhancements to Codable support: + +```diff protocol FetchableRecord { + static var databaseDecodingUserInfo: [CodingUserInfoKey: Any] { get } + static func databaseJSONDecoder(for column: String) -> JSONDecoder @@ -36,7 +43,27 @@ Release Notes + static var databaseEncodingUserInfo: [CodingUserInfoKey: Any] { get } + static func databaseJSONEncoder(for column: String) -> JSONEncoder } +``` +Query Interface: set the selection and the fetched type in a single method call: + +```diff + extension QueryInterfaceRequest { ++ func select(_ selection: [SQLSelectable], as type: RowDecoder.Type) -> QueryInterfaceRequest ++ func select(_ selection: SQLSelectable..., as type: RowDecoder.Type) -> QueryInterfaceRequest ++ func select(sql: String, arguments: StatementArguments? = nil, as type: RowDecoder.Type) -> QueryInterfaceRequest + } + + extension TableRecord { ++ static func select(_ selection: [SQLSelectable], as type: RowDecoder.Type) -> QueryInterfaceRequest ++ static func select(_ selection: SQLSelectable..., as type: RowDecoder.Type) -> QueryInterfaceRequest ++ static func select(sql: String, arguments: StatementArguments? = nil, as type: RowDecoder.Type) -> QueryInterfaceRequest + } +``` + +Deprecations: + +```diff +final class FastDatabaseValueCursor : Cursor { } +@available(*, deprecated, renamed: "FastDatabaseValueCursor") +typealias ColumnCursor = FastDatabaseValueCursor @@ -52,6 +79,7 @@ Release Notes - [Enabling FTS5 Support](README.md#enabling-fts5-support): Procedure for enabling FTS5 support in GRDB. - [Codable Records](README.md#codable-records): Updated documentation for JSON columns, tips, and customization options. - [Record Customization Options](README.md#record-customization-options): A new chapter that gather all your customization options. +- [Fetching from Requests](README.md#fetching-from-requests): Enhanced documentation about requests that don't fetch their origin record (such as aggregates, or associated records). ## 3.2.0