Commit Graph
120 Commits
Author SHA1 Message Date
Gwendal Roué c90560fda9 Documentation 2019-05-21 20:35:13 +02:00
Gwendal Roué 059ae19974 QueryInterfaceRequest unconditionnally conforms to TableRequest 2019-05-21 19:18:26 +02:00
Gwendal Roué a4a26e01e7 SelectionRequest.annotated(with:) 2019-05-21 08:05:07 +02:00
Gwendal Roué 1a368d30b0 Cleanup 2019-05-18 15:03:17 +02:00
Gwendal Roué 27cbe18c51 Pass tests for database region of prefetching requests 2019-05-18 14:09:00 +02:00
Gwendal Roué 2a85d89364 Cleanup 2019-05-17 18:16:01 +02:00
Gwendal Roué 3786482368 Add unordered() to OrderedRequest 2019-05-17 17:53:25 +02:00
Gwendal Roué acb7432610 TODO 2019-05-05 20:23:23 +02:00
Gwendal Roué 623f2eaf43 First tests for consumption of prefetched rows 2019-05-05 13:54:55 +02:00
Gwendal Roué 91ec3bada3 Group prefetched rows 2019-05-04 22:29:07 +02:00
Gwendal Roué 2ca2f11883 First prefetch and passing tests 2019-05-04 17:02:19 +02:00
Gwendal Roué a88f20fb50 Introduce including(all:) 2019-05-04 12:24:43 +02:00
Gwendal Roué 4716f91d8b Bake the single result expectation right into filter(key:) methods
This better hides this flag inside SQLSelectQuery, and avoids explicit support from FetchableRecord and TableRecord
2019-04-16 08:47:50 +02:00
Gwendal Roué 46791c8f74 Remove QueryInterfaceRequest.init(query:) 2019-04-16 07:56:44 +02:00
Alex Robinson e2211aca21 Exclude LIMIT 1 in more cases
Adds a flag to SQLSelectQuery indicating that it expects a single record (for example when querying by primary or unique key).

Ensures that this example doesn't add an unnecessary LIMIT 1 to the resulting query:

    let request = Player.filter(key: 123) // or Player.filter(key: ["email": "me@example.com"])
    let player = try dbQueue.read { db in try request.fetchOne(db) }
2019-04-16 11:10:43 +10:00
Alex Robinson 7070dedf1a Replace FetchRequestHint with a boolean for single results
Fixes previous test failure
2019-04-16 10:20:36 +10:00
Alex Robinson 088f6c92c7 Update inline docs 2019-04-11 13:50:57 +10:00
Alex Robinson 072fa2583a Add hints for use in request preparation
Hints are ignored by SQLRequest. When you write raw SQL you probably don't want GRDB to modify your query.
2019-04-11 13:14:41 +10:00
Gwendal Roué cf4e512894 Documentation 2019-03-13 21:24:54 +01:00
Gwendal Roué e2a11eeb05 Update some inline documentation 2019-02-17 13:28:41 +01:00
Gwendal Roué db67d3840b Principle of least astonishment: rrename argument label rawSQL to sql 2019-02-17 13:28:41 +01:00
Gwendal Roué a57aa2e346 rawSQL migration complete 2019-02-17 13:28:40 +01:00
Gwendal Roué 4bd5ace2ee Use rawSQL as parameter name for raw SQL 2019-02-17 13:28:40 +01:00
Gwendal Roué 354d22d70d Update documentation for literal interpolation 2019-02-17 13:24:38 +01:00
Gwendal Roué 637de8b6fa SQLiteral are passed via a literal parameter 2019-02-17 13:24:38 +01:00
Gwendal Roué aa6f55d72f Statement arguments are generally non optional 2019-02-17 13:24:38 +01:00
Gwendal Roué f018c7f823 Rename SQLString to SQLLiteral 2019-02-17 13:24:38 +01:00
Gwendal Roué 09e85ba341 SQLString everywhere 2019-02-17 13:24:38 +01:00
Gwendal Roué f27a1e9504 request.select(SQLString) 2019-02-17 13:24:38 +01:00
Gwendal Roué e924587236 Extract generation of SQL SELECT queries into SQLSelectQueryGenerator 2019-02-03 14:56:28 +01:00
Gwendal Roué 27c6390635 More Association trimming 2019-02-02 17:53:01 +01:00
Gwendal Roué e62cfe086c Documentation 2019-02-02 17:23:50 +01:00
Gwendal Roué 40f6b351ea Rename QueryInterfaceQuery to SQLSelectQuery 2019-02-02 17:15:29 +01:00
Gwendal Roué 9addac6f54 Rename QueryOrdering to SQLRelation.Ordering 2019-02-02 16:43:10 +01:00
Gwendal Roué 5a942d7213 More trimming: QueryInterfaceQuery now embeds a SQLRelation 2019-02-02 16:20:43 +01:00
Gwendal Roué bb972a351a Refactor JoinQuery into SQLRelation 2019-02-02 15:39:18 +01:00
Gwendal Roué 5f037c7e4e Replace JoinQuery initializer with QueryInterfaceRequest.asJoinQuery() 2019-02-02 14:54:31 +01:00
Gwendal Roué b180fc37bb Trim associations 2019-02-02 10:38:47 +01:00
Gwendal Roué 2938a95270 Inline documentation 2018-10-08 08:24:14 +02:00
Gwendal Roué 39bc140dc8 Rename Annotation to AssociationAggregate 2018-10-07 11:39:46 +02:00
Gwendal Roué 903694d095 First annotation: HasManyAssociaton.count 2018-10-05 18:50:33 +02:00
Gwendal Roué 168d2850ab Introduce groupByPrimaryKey() 2018-10-05 18:50:33 +02:00
Gwendal Roué 8af33c4fc9 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)
2018-08-19 12:25:27 +02:00
Gwendal Roué fa31c484da OrderedRequest now waits for the database connection before ordering is computed 2018-06-05 22:46:02 +02:00
Gwendal Roué 756863152c Fix documentation typos 2018-05-07 19:33:07 +02:00
Gwendal Roué 2d008b8c54 Yet another request protocols update, in order to empower RxGRDB 2018-05-05 11:57:17 +02:00
Gwendal Roué cdad6fa313 Introduce DerivableRequest 2018-05-04 14:19:27 +02:00
Gwendal Roué 1bf7f67008 Update inline documentation with singular table names 2018-05-01 20:32:18 +02:00
Gwendal Roué ab36df6e0f Use "finalized" to describe queries that are ready for SQL generation 2018-05-01 17:42:39 +02:00
Gwendal Roué ffaabdfd62 Toward improved DatabaseRegion for joined requests 2018-05-01 17:20:37 +02:00