| 79 | } |
| 80 | |
| 81 | async insertAndGet(standardInsertQuery: SqlQuery): Promise<number[]|string[]|any[]> { |
| 82 | return new Promise((resolve, reject) => { |
| 83 | const compiledQuery = standardInsertQuery.compile(this.indexToPlaceholder, formatIdentifier); |
| 84 | |
| 85 | this.connection.run( |
| 86 | compiledQuery.sql, |
| 87 | <any[]><any>compiledQuery.params, |
| 88 | function (error: Error|null) { |
| 89 | if (error) { |
| 90 | reject(error); |
| 91 | } else { |
| 92 | resolve([this.lastID]); |
| 93 | } |
| 94 | }, |
| 95 | ); |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | async updateAndGet(standardUpdateQuery: SqlQuery): Promise<null|any[]> { |
| 100 | await this.query(standardUpdateQuery); |