MCPcopy Index your code
hub / github.com/simstudioai/sim / makeReadBuilder

Function makeReadBuilder

apps/sim/lib/workspaces/fork/copy/cleanup-failed.test.ts:19–28  ·  view source on GitHub ↗
(table: unknown)

Source from the content-addressed store, hash-verified

17 // A drizzle-style read builder bound to one table: `.where`/`.orderBy`/`.limit` chain back to
18 // the same builder, and awaiting it (at `.where()` or `.limit()`) shifts that table's next page.
19 const makeReadBuilder = (table: unknown) => {
20 const builder = {
21 where: () => builder,
22 orderBy: () => builder,
23 limit: () => builder,
24 then: (onFulfilled: (rows: unknown[]) => unknown, onRejected?: (error: unknown) => unknown) =>
25 Promise.resolve(nextPage(table)).then(onFulfilled, onRejected),
26 }
27 return builder
28 }
29
30 const db = {
31 select: () => ({ from: (table: unknown) => makeReadBuilder(table) }),

Callers 1

Calls 2

nextPageFunction · 0.85
resolveMethod · 0.65

Tested by

no test coverage detected