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

Method executeRaw

cli/api/dbadapters/bigquery.ts:132–155  ·  view source on GitHub ↗
(
    statement: string,
    options: {
      params?: { [name: string]: any };
      rowLimit?: number;
      bigquery?: IBigQueryExecutionOptions;
    } = { rowLimit: 1000 }
  )

Source from the content-addressed store, hash-verified

130 }
131
132 public async executeRaw(
133 statement: string,
134 options: {
135 params?: { [name: string]: any };
136 rowLimit?: number;
137 bigquery?: IBigQueryExecutionOptions;
138 } = { rowLimit: 1000 }
139 ): Promise<IExecutionResultRaw> {
140 if (!statement) {
141 throw new Error("Query string cannot be empty");
142 }
143 return this.pool
144 .addSingleTask({
145 generator: async () => {
146 const [rows, , apiResponse] = await this.getClient().query({
147 ...this.prepareQueryOptions(statement, options.rowLimit, options.bigquery, options.params),
148 skipParsing: true
149 } as any);
150 const schema = apiResponse?.schema?.fields?.map((field: any) => convertField(field));
151 return { rows, schema, metadata: {} };
152 }
153 })
154 .promise();
155 }
156
157 public async withClientLock<T>(callback: (client: IDbClient) => Promise<T>) {
158 return await callback(this);

Callers

nothing calls this directly

Calls 4

getClientMethod · 0.95
prepareQueryOptionsMethod · 0.95
convertFieldFunction · 0.85
queryMethod · 0.45

Tested by

no test coverage detected