(
statement: string,
options: {
params?: { [name: string]: any };
rowLimit?: number;
bigquery?: IBigQueryExecutionOptions;
} = { rowLimit: 1000 }
)
| 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); |
nothing calls this directly
no test coverage detected