Skip to content

Commit

Permalink
core: fix async iterator on sql collection only returning `dateCreate…
Browse files Browse the repository at this point in the history
…d` & `id`
  • Loading branch information
thecodrr committed May 10, 2024
1 parent cb70bb9 commit 5ab721e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/database/sql-collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,11 @@ export class FilteredSelector<T extends Item> {
async *[Symbol.asyncIterator]() {
let lastRow: any | null = null;
const fields = this._fields.slice();
if (!fields.find((f) => f.includes(".dateCreated")))
fields.push("dateCreated");
if (!fields.find((f) => f.includes(".id"))) fields.push("id");
if (fields.length > 0) {
if (!fields.find((f) => f.includes(".dateCreated")))
fields.push("dateCreated");
if (!fields.find((f) => f.includes(".id"))) fields.push("id");
}

while (true) {
const rows = await this.filter
Expand Down

0 comments on commit 5ab721e

Please sign in to comment.