(queryDescription: QueryDescription)
| 70 | |
| 71 | // deno-lint-ignore no-explicit-any |
| 72 | async query(queryDescription: QueryDescription): Promise<any | any[]> { |
| 73 | await this._makeConnection(); |
| 74 | |
| 75 | const query = this._translator.translateToQuery(queryDescription); |
| 76 | const response = await this._client.queryObject(query); |
| 77 | const results = response.rows as Values[]; |
| 78 | |
| 79 | if (queryDescription.type === "insert") { |
| 80 | return results.length === 1 ? results[0] : results; |
| 81 | } |
| 82 | |
| 83 | return results; |
| 84 | } |
| 85 | |
| 86 | async transaction(queries: () => Promise<void>) { |
| 87 | const transaction = this._client.createTransaction("transaction"); |
nothing calls this directly
no test coverage detected