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
Gwendal Roué
8e2cdeebc3
Cleanup
2018-05-01 15:03:36 +02:00
Gwendal Roué
66a425f718
Thread-safe table name disambiguation, via SQLGenerationContext. Merge SQLTableQualifier into TableAlias.
2018-05-01 14:44:51 +02:00
Gwendal Roué
09458c1d37
Documentation, move asRequest(of:) to QueryInterfaceRequest in order to avoid AnyFetchRequest contamination
2018-04-30 13:41:20 +02:00
Gwendal Roué
dddeff458a
none() is no longer a requirement of FilteredRequest
2018-04-30 09:02:05 +02:00
Gwendal Roué
ccc259c25c
Documentation
2018-04-30 08:55:16 +02:00
Gwendal Roué
4586eb9a82
Associations Documentation
2018-04-29 18:27:59 +02:00
Gwendal Roué
3e46942f30
Associations
2018-04-29 18:16:39 +02:00
Gwendal Roué
26108badd4
request.reversed() has no effect when request is not already ordered
2018-04-26 12:51:29 +02:00