return inserted ids

This commit is contained in:
Charlie Kolb 2025-08-20 11:45:58 +02:00
parent fb3a2ae216
commit 905efcd886
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View File

@ -973,7 +973,7 @@ describe('dataStore', () => {
const result = await dataStoreService.insertRows(dataStoreId, project1.id, rows);
// ASSERT
expect(result).toBe(true);
expect(tresult).toBe(true);
const { count, data } = await dataStoreService.getManyRowsAndCount(
dataStoreId,

View File

@ -58,11 +58,10 @@ export class DataStoreRowsRepository {
columns: DataStoreColumn[],
) {
const dbType = this.dataSource.options.type;
await this.dataSource.query.apply(
return (await this.dataSource.query.apply(
this.dataSource,
buildInsertQuery(tableName, rows, columns, dbType),
);
return true;
)) as number;
}
async upsertRows(

View File

@ -233,6 +233,9 @@ export class DataStoreController {
}
}
/**
* @returns the IDs of the inserted rows
*/
@Post('/:dataStoreId/insert')
@ProjectScope('dataStore:writeRow')
async appendDataStoreRows(