mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-03 10:17:00 +02:00
return inserted ids
This commit is contained in:
parent
fb3a2ae216
commit
905efcd886
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -233,6 +233,9 @@ export class DataStoreController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns the IDs of the inserted rows
|
||||
*/
|
||||
@Post('/:dataStoreId/insert')
|
||||
@ProjectScope('dataStore:writeRow')
|
||||
async appendDataStoreRows(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user