| 3 | import { dataform } from "df/protos/ts"; |
| 4 | |
| 5 | export 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 | |
| 29 | export async function evaluate( |
| 30 | dbadapter: dbadapters.IDbAdapter, |