Commit Graph
6816 Commits
Author SHA1 Message Date
Gwendal Roué 65fe2bb50c Tests for the singleResult hint and fetching methods 2019-04-17 21:31:30 +02:00
Gwendal Roué e3a0935914 Add SQL tests for all record testFetchOne…() methods
We usually update all those tests together
2019-04-17 14:01:16 +02:00
Gwendal Roué 693e6da773 Do not test that fetchOne does not add LIMIT 1 to raw SQL requests
We do not add LIMIT 1 to raw SQL requests because it is difficult. But it would not be wrong to do so.
2019-04-17 13:08:51 +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 1b3f0e8ece Update FetchRequest protocol in README 2019-04-16 11:11:37 +10: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 235a612ce0 Remove LIMIT 1 from expected SQL when filtering by key
Tests now fail
2019-04-16 10:29:40 +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 20aecd5328 Add failing test for fetchOne with a non-zero offset 2019-04-16 10:20:36 +10:00
Alex Robinson 088f6c92c7 Update inline docs 2019-04-11 13:50:57 +10:00
Alex Robinson 207b90f1b5 Update FetchRequest protocol in README 2019-04-11 13:27:32 +10:00
Alex Robinson dd139b6268 Fix testing lastSQLQuery when a cursor hasn't retrieved a record
This problem was masked by the fact all queries in the test expected the same SQL query.
2019-04-11 13:19:04 +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
Alex Robinson af1fd6b90c More tests for presence of LIMIT 1 2019-04-11 13:08:29 +10:00
Alex Robinson f9868bd8b5 Update tests to expect "LIMIT 1" where appropriate
Tests currently fail
2019-04-11 11:51:16 +10:00
Gwendal Roué bf012614bc CHANGELOG and thank you notice 2019-04-05 07:49:16 +02:00
Gwendal Roué aeeb59601a Merge pull request #511 from signalapp/charlesmchen/fixPoolNotificationName
Fix notification name.
2019-04-05 07:43:02 +02:00
Matthew Chen 325b376f4c Fix notification name. 2019-04-04 18:01:12 -04:00
Gwendal Roué d41f6b4466 Makefile: support for Xcode 10.2 2019-03-28 07:08:18 +01:00
Gwendal Roué bfa5fbe8ce Documentation tweaks 2019-03-20 16:50:03 +01:00
Gwendal Roué 900134729a Where has count(where:) gone? 2019-03-16 15:31:00 +01:00
Gwendal Roué d888423676 Fix outdated documentation 2019-03-16 14:32:10 +01:00
Gwendal Roué eac38be34b Fix for Swift 5 2019-03-16 14:26:06 +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é 0074adc023 Merge pull request #502 from groue/feature/rename-future
Rename Future to DatabaseFuture
2019-03-15 07:56:56 +01:00
Gwendal Roué ca8987ad98 Remove ill-advised TODOs 2019-03-14 07:57:30 +01:00
Gwendal Roué 6460f639ee Cleanup: SQLRelation, JoinOperator, JoinCondition are no longer public 2019-03-14 07:54:45 +01:00
Gwendal Roué 41d93f546c Document aggregate operations 2019-03-14 07:46:49 +01:00
Gwendal Roué 80a642260f CHANGELOG 2019-03-14 07:29:47 +01:00
Gwendal Roué 39800b1257 IFNULL support for aggregates 2019-03-14 07:21:09 +01:00
Gwendal Roué d04fc07337 CHANGELOG 2019-03-14 07:02:39 +01:00
Gwendal Roué 11fd8d6b87 Update documentation 2019-03-14 07:01:39 +01:00
Gwendal Roué 7183457217 Rename Future to DatabaseFuture 2019-03-14 06:43:40 +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é 9d9bbc5f5d Documentation 2019-03-13 10:24:00 +01:00
Gwendal Roué 153233ace4 Documentation 2019-03-13 10:16:46 +01:00
Gwendal Roué 4bae8e9ac5 More request(for:association) tests 2019-03-13 08:33:14 +01:00
Gwendal Roué 1e617381a8 AssociationsBasics.md: remove inner link 2019-03-13 07:57:01 +01:00
Gwendal Roué 6d5215c8cb One less contribution needed #499 2019-03-11 09:02:48 +01:00
Gwendal Roué 4ce6271f6d Merge pull request #499 from groue/feature/EndodableRecord
Extract EncodableRecord from MutablePersistableRecord
2019-03-10 23:01:24 +01:00
Gwendal Roué 10c75d1e5e CHANGELOG 2019-03-10 15:25:39 +01:00
Gwendal Roué 05258b1098 Fix SPM build 2019-03-10 15:21:39 +01:00
Gwendal Roué 1a513e8e6e EncodableRecord documentation 2019-03-10 15:07:05 +01:00