Effect CommunityEC
Effect Community4mo ago
3 replies
Silvan

Error with `batch` and Promise Return Type in sql-drizzle

does batch work differently with sql-drizzle?
i get this weird error and idk why this is the case
├╴E Type 'Promise<[{ id: string; status: "ACTIVE" | "EXPIRED" | "DELETED"; }[]]>' must have a '[Symbol.iterator]()' method that returns an iterator. typescript (2488) [57, 26]


sadly i didnt find an example using batch

my code is simple like

const result = yield* db.batch([
  db
    .update(listings)
    .set(updateData)
    .where(eq(listings.id, listingId))
    .returning({ id: listings.id, status: listings.status })
]);
Was this page helpful?