| 110 | } |
| 111 | |
| 112 | async insertAndGet(standardInsertQuery: SqlQuery): Promise<number[]|string[]|any[]> { |
| 113 | return new Promise((resolve, reject) => { |
| 114 | const compiledQuery = standardInsertQuery.compile(this.indexToPlaceholder, formatIdentifier); |
| 115 | |
| 116 | this.connection.query( |
| 117 | compiledQuery.sql, |
| 118 | <any[]><any>compiledQuery.params, |
| 119 | (error, { insertId }) => { |
| 120 | if (error) { |
| 121 | reject(error); |
| 122 | } else { |
| 123 | resolve([insertId]); |
| 124 | } |
| 125 | }, |
| 126 | ); |
| 127 | }); |
| 128 | } |
| 129 | |
| 130 | async updateAndGet(standardUpdateQuery: SqlQuery): Promise<null|any[]> { |
| 131 | await this.query(standardUpdateQuery); |