fix(Postgres Node): RMC do not mark collumn as required if identity_generation is BY DEFAULT (#13752)

Co-authored-by: Dana <152518854+dana-gill@users.noreply.github.com>
This commit is contained in:
Michael Kret
2025-03-13 07:35:50 +02:00
committed by GitHub
parent ec8a719efa
commit b5632545c5
7 changed files with 149 additions and 9 deletions

View File

@@ -713,6 +713,51 @@ describe('Test PostgresV2, insert operation', () => {
expect(hasJsonDataTypeInSchemaSpy).toHaveBeenCalledWith(columnsInfo);
});
});
it('should insert default values if no values are provided', async () => {
const nodeParameters: IDataObject = {
schema: {
__rl: true,
mode: 'list',
value: 'public',
},
table: {
__rl: true,
value: 'my_table',
mode: 'list',
},
dataMode: 'defineBelow',
valuesToSend: {
values: [],
},
options: { nodeVersion: 2.6 },
};
const columnsInfo: ColumnInfo[] = [
{ column_name: 'id', data_type: 'integer', is_nullable: 'NO', udt_name: '' },
];
const nodeOptions = nodeParameters.options as IDataObject;
await insert.execute.call(
createMockExecuteFunction(nodeParameters),
runQueries,
items,
nodeOptions,
createMockDb(columnsInfo),
pgPromise(),
);
expect(runQueries).toHaveBeenCalledWith(
[
{
query: 'INSERT INTO $1:name.$2:name DEFAULT VALUES RETURNING *',
values: ['public', 'my_table', {}],
},
],
items,
nodeOptions,
);
});
});
describe('Test PostgresV2, select operation', () => {