AssociationPrefetchingSQLTests: no need for association keys

This commit is contained in:
Gwendal Roué committed 2019-05-18 16:02:00 +02:00
1 parent cd53e0102b
commit 5113d08ce3
1 file changed
+10 -19
@@ -75,8 +75,7 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
let request = A
.including(all: A
.hasMany(B.self)
.orderByPrimaryKey()
.forKey("bs")) // TODO: auto-pluralization
.orderByPrimaryKey())
.orderByPrimaryKey()
sqlQueries.removeAll()
@@ -166,10 +165,8 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
.hasMany(C.self)
.including(all: C
.hasMany(D.self)
.orderByPrimaryKey()
.forKey("ds")) // TODO: auto-pluralization
.orderByPrimaryKey()
.forKey("cs")) // TODO: auto-pluralization
.orderByPrimaryKey())
.orderByPrimaryKey())
.orderByPrimaryKey()
sqlQueries.removeAll()
@@ -203,8 +200,7 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
.including(all: C
.hasMany(D.self)
.orderByPrimaryKey())
.orderByPrimaryKey()
.forKey("cs")) // TODO: auto-pluralization
.orderByPrimaryKey())
.orderByPrimaryKey()
sqlQueries.removeAll()
@@ -321,8 +317,7 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
.including(required: C
.hasMany(D.self)
.orderByPrimaryKey())
.orderByPrimaryKey()
.forKey("cs")) // TODO: auto-pluralization
.orderByPrimaryKey())
.orderByPrimaryKey()
sqlQueries.removeAll()
@@ -351,8 +346,7 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
.including(required: C
.hasMany(D.self)
.orderByPrimaryKey())
.orderByPrimaryKey()
.forKey("cs")) // TODO: auto-pluralization
.orderByPrimaryKey())
.orderByPrimaryKey()
sqlQueries.removeAll()
@@ -447,8 +441,7 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
let request = A
.including(all: A
.hasMany(D.self, through: A.hasMany(C.self), using: C.hasMany(D.self))
.orderByPrimaryKey()
.forKey("ds")) // TODO: auto-pluralization
.orderByPrimaryKey())
.orderByPrimaryKey()
sqlQueries.removeAll()
@@ -526,13 +519,12 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
try dbQueue.read { db in
// Plain request
do {
let cs = A.hasMany(C.self).forKey("cs")
let cs = A.hasMany(C.self)
let request = A
.including(all: cs.orderByPrimaryKey())
.including(all: A
.hasMany(D.self, through: cs, using: C.hasMany(D.self))
.orderByPrimaryKey()
.forKey("ds")) // TODO: auto-pluralization
.orderByPrimaryKey())
.orderByPrimaryKey()
sqlQueries.removeAll()
@@ -631,8 +623,7 @@ class AssociationPrefetchingSQLTests: GRDBTestCase {
.belongsTo(A.self)
.including(all: A
.hasMany(C.self)
.orderByPrimaryKey()
.forKey("cs")) // TODO: auto-pluralization
.orderByPrimaryKey())
)
.orderByPrimaryKey()