Commit Graph
330 Commits
Author SHA1 Message Date
Wolfgang Lutz 8fcabb5b73 fix typos in documentation 2019-04-26 11:50:22 +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é 900134729a Where has count(where:) gone? 2019-03-16 15:31:00 +01:00
Gwendal Roué f42a184401 Merge pull request #503 from groue/feature/aggregate-ifnull
IFNULL support for association aggregates
2019-03-15 13:06:56 +01:00
Gwendal Roué 5fbf56c373 KISS 2019-03-15 08:51:02 +01:00
Gwendal Roué 784ebcc8e9 Tighten SQLJoin 2019-03-15 08:41:57 +01:00
Gwendal Roué df84654554 Delete unused code 2019-03-15 08:23:08 +01:00
Gwendal Roué 53e513f1f8 Merge branch 'GRDB-4.0' into feature/aggregate-ifnull
# Conflicts:
#	CHANGELOG.md
2019-03-15 07:58:42 +01:00
Gwendal Roué 6460f639ee Cleanup: SQLRelation, JoinOperator, JoinCondition are no longer public 2019-03-14 07:54:45 +01:00
Gwendal Roué 39800b1257 IFNULL support for aggregates 2019-03-14 07:21:09 +01:00
Gwendal Roué cf4e512894 Documentation 2019-03-13 21:24:54 +01:00
Gwendal Roué cf837855f2 HasManyThroughAssociation and HasOneThroughAssociation doc 2019-03-13 21:19:13 +01:00
Gwendal Roué 916d3931aa Cleanup SQLAssociation 2019-03-13 20:47:55 +01:00
Gwendal Roué 4ae1fb11cc Extract EncodableRecord from MutablePersistableRecord
This fixes issue #426
2019-03-10 14:00:01 +01:00
Gwendal Roué 7ff21981f0 Restore tests by disabling a sanity check 2019-03-06 09:08:59 +01:00
Gwendal Roué 5d9fa76754 Fix fetchCount(_:) for joined queries 2019-03-06 08:59:06 +01:00
Gwendal Roué 87cd76a468 Association aggregates are defined on AssociationToMany 2019-03-06 08:17:20 +01:00
Gwendal Roué addfa45d3a hasMany(_:through:using:) 2019-03-04 08:52:07 +01:00
Gwendal Roué 6489c80846 hasOne(_:through:using:) 2019-03-04 08:49:03 +01:00
Gwendal Roué 9ee25fdec1 Rename ToOneAssociation to AssociationToOne 2019-03-04 08:01:45 +01:00
Gwendal Roué 4d5e5e1de3 HasManyThroughAssociation 2019-03-03 18:35:05 +01:00
Gwendal Roué 1188969144 Cleanup 2019-03-03 17:34:23 +01:00
Gwendal Roué 66c72e7bd2 HasOneThroughAssociation request tests 2019-03-03 15:29:27 +01:00
Gwendal Roué 1a24f61723 HasOneThroughAssociation adopts TableRequest 2019-03-02 17:24:17 +01:00
Gwendal Roué 5cf2d4920d TODO 2019-03-02 15:37:44 +01:00
Gwendal Roué 3d6d1c89b2 HasOneThroughAssociation 2019-03-02 14:46:31 +01:00
Gwendal Roué 08451dfced Rename AssociationImpl to SQLAssociation 2019-03-02 14:46:12 +01:00
Gwendal Roué b506838519 ToOneAssociation 2019-03-01 19:13:46 +01:00
Gwendal Roué 1511981dc7 AssociationImpl is no longer a protocol 2019-03-01 19:13:28 +01:00
Gwendal Roué 61ae460525 Persistence methods specialization, PersistenceContainer optimizations 2019-02-24 06:26:08 +01:00
Gwendal Roué 22c2cfb4ea Test SQLRequest interpolation 2019-02-22 13:28:58 +01:00
Gwendal Roué 59cc1fef67 SQLInterpolation.md 2019-02-21 23:10:06 +01:00
Gwendal Roué 8df8129743 SQLInterpolation.appendInterpolation(SQLRequest) 2019-02-21 14:20:50 +01:00
Gwendal Roué 7e9e50e52d Up to date playgrounds 2019-02-17 13:28:41 +01:00
Gwendal Roué 8d6a2fb4f1 Documentation, support for interpolation of empty sequences 2019-02-17 13:28:41 +01:00
Gwendal Roué afa8360397 Restore SQLExpressionLiteral.sql and arguments 2019-02-17 13:28:41 +01:00
Gwendal Roué 36ce78bd37 Explicit sql argument label when building prepared statements 2019-02-17 13:28:41 +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é b296e9824a SQLGenerationContext.append(arguments:) cleanup 2019-02-17 13:28:40 +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é 85f618e16e SQLLiteral.mapSQL 2019-02-17 13:28:40 +01:00
Gwendal Roué e7995b9cd4 SQLExpressionLiteral(rawSQL:) 2019-02-17 13:28:40 +01:00
Gwendal Roué c546c578ce fetchCursor/All/One(_:rawSQL:arguments:adapter:) 2019-02-17 13:28:40 +01:00