MCPcopy Create free account
hub / github.com/dataform-co/dataform / run

Function run

cli/api/commands/query.ts:5–27  ·  view source on GitHub ↗
(
  dbadapter: dbadapters.IDbAdapter,
  query: string,
  options?: {
    compileConfig?: dataform.ICompileConfig;
    rowLimit?: number;
    byteLimit?: number;
  }
)

Source from the content-addressed store, hash-verified

3import { dataform } from "df/protos/ts";
4
5export function run(
6 dbadapter: dbadapters.IDbAdapter,
7 query: string,
8 options?: {
9 compileConfig?: dataform.ICompileConfig;
10 rowLimit?: number;
11 byteLimit?: number;
12 }
13): CancellablePromise<any[]> {
14 return new CancellablePromise(async (resolve, reject, onCancel) => {
15 try {
16 const results = await dbadapter.execute(query, {
17 onCancel,
18 interactive: true,
19 rowLimit: options?.rowLimit,
20 byteLimit: options?.byteLimit
21 });
22 resolve(results.rows);
23 } catch (e) {
24 reject(e);
25 }
26 });
27}
28
29export async function evaluate(
30 dbadapter: dbadapters.IDbAdapter,

Callers

nothing calls this directly

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected