(
schemaName: string,
tableName: string,
key: Record<string, DatabaseValue>
)
| 148 | } |
| 149 | |
| 150 | async findFirst( |
| 151 | schemaName: string, |
| 152 | tableName: string, |
| 153 | key: Record<string, DatabaseValue> |
| 154 | ): Promise<DatabaseResultSet> { |
| 155 | const wherePart = Object.entries(key) |
| 156 | .map(([colName, colValue]) => { |
| 157 | return `${this.escapeId(colName)} = ${escapeSqlValue(colValue)}`; |
| 158 | }) |
| 159 | .join(" AND "); |
| 160 | |
| 161 | const sql = `SELECT * FROM ${this.escapeId(schemaName)}.${this.escapeId(tableName)} ${wherePart ? "WHERE " + wherePart : ""} LIMIT 1 OFFSET 0`; |
| 162 | return this.query(sql); |
| 163 | } |
| 164 | |
| 165 | async selectTable( |
| 166 | schemaName: string, |
nothing calls this directly
no test coverage detected