(
table_id: string,
rowId: string,
query: string
)
| 148 | } |
| 149 | |
| 150 | public async findRowIndexInQuery( |
| 151 | table_id: string, |
| 152 | rowId: string, |
| 153 | query: string |
| 154 | ): Promise<number> { |
| 155 | const tableName = `tb_${table_id}` |
| 156 | console.log("findRowIndexInQuery", tableName, rowId, query) |
| 157 | try { |
| 158 | // Check if the row exists in the temporary table |
| 159 | const newQuery = replaceWithFindIndexQuery(query, rowId) |
| 160 | const result = await this.dataSpace.exec2(newQuery) |
| 161 | console.log("result", query, result) |
| 162 | return result[0]._index_in_view as number |
| 163 | } catch (error) { |
| 164 | console.error(error) |
| 165 | } finally { |
| 166 | // Drop the temporary table |
| 167 | // await this.dataSpace.exec2(`DROP TABLE ${tmpTableName}`) |
| 168 | } |
| 169 | return 1 |
| 170 | } |
| 171 | |
| 172 | // after entity field changed, the formula field may be changed, so we need to recompute the formula field |
| 173 | @timeit(100) |
no test coverage detected