MCPcopy
hub / github.com/simstudioai/sim / whereBuilder

Function whereBuilder

packages/testing/src/mocks/database.mock.ts:130–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128const onConflictDoNothing = vi.fn(() => ({ returning }) as unknown as Promise<void>)
129
130const whereBuilder = () => {
131 // Some call sites (e.g. `db.select().from(t).where(eq(...))` with no
132 // limit/orderBy) await the where directly. Make the builder a thenable so
133 // those calls resolve to the default empty array.
134 const thenable: any = Promise.resolve([] as unknown[])
135 thenable.limit = limit
136 thenable.orderBy = orderBy
137 thenable.returning = returning
138 thenable.groupBy = groupBy
139 thenable.for = forClause
140 return thenable
141}
142const where = vi.fn(whereBuilder)
143
144const joinBuilder = (): { where: typeof where; innerJoin: any; leftJoin: any } => ({

Callers

nothing calls this directly

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected