                     XCTAssertEqual(row.prefetches["ds2"]!.count, 1)
                     XCTAssertEqual(row.prefetches["ds2"]![0], ["cold1": 10, "cold2": 7, "cold3": "d1", "grdb_colc2": 1]) // TODO: remove grdb_ column?
                     XCTAssertEqual(row.prefetches["ds3"]!.count, 0)
+                }
+                
+                // Record.fetchAll
+                struct Record: FetchableRecord, Decodable, Equatable {
+                    var a: A
+                    var ds1: [D]
+                    var ds2: [D]
+                    var ds3: [D]
+                }
+                
+                do {
+                    let records = try Record.fetchAll(db, request)
+                    XCTAssertEqual(records, [
+                        Record(
+                            a: A(row: ["cola1": 1, "cola2": "a1"]),
+                            ds1: [],
+                            ds2: [
+                                D(row: ["cold1": 10, "cold2": 7, "cold3": "d1"]),
+                            ],
+                            ds3: []),
+                        Record(
+                            a: A(row: ["cola1": 2, "cola2": "a2"]),
+                            ds1: [
+                                D(row: ["cold1": 11, "cold2": 8, "cold3": "d2"]),
+                                D(row: ["cold1": 12, "cold2": 8, "cold3": "d3"]),
+                            ],
+                            ds2: [
+                                D(row: ["cold1": 12, "cold2": 8, "cold3": "d3"]),
+                                D(row: ["cold1": 13, "cold2": 9, "cold3": "d4"]),
+                            ],
+                            ds3: [
+                                D(row: ["cold1": 11, "cold2": 8, "cold3": "d2"]),
+                            ]),
+                        ])
+                }
+                
+                // Record.fetchOne
+                do {
+                    let record = try Record.fetchOne(db, request)!
+                    XCTAssertEqual(record, Record(
+                        a: A(row: ["cola1": 1, "cola2": "a1"]),
+                        ds1: [],
+                        ds2: [
+                            D(row: ["cold1": 10, "cold2": 7, "cold3": "d1"]),
+                        ],
+                        ds3: []))
                 }
             }
         }

                    XCTAssertEqual(row.prefetches["ds"]!.count, 1)
                    XCTAssertEqual(row.prefetches["ds"]![0], ["cold1": 10, "cold2": 7, "cold3": "d1", "grdb_colc2": 1]) // TODO: remove grdb_ column?
                }
            }
            
            // Request with filters

                let request = A
                    .filter(Column("cola1") != 3)
                    .including(all: A
                        .hasMany(D.self, through: A.hasMany(C.self).filter(Column("colc1") == 8), using: C.hasMany(D.self))
                        .orderByPrimaryKey()
                        .forKey("ds1"))
                    .including(all: A
                        .hasMany(D.self, through: A.hasMany(C.self), using: C.hasMany(D.self))
                        .filter(Column("cold1") != 11)
                        .orderByPrimaryKey()
                        .forKey("ds2"))
                    .including(all: A
                        .hasMany(D.self, through: A.hasMany(C.self), using: C.hasMany(D.self))
                        .filter(Column("cold1") == 11)
                        .orderByPrimaryKey()
                        .forKey("ds3"))
