fix(Postgres Node): Accommodate null values in query parameters for expressions (#13544)

This commit is contained in:
Dana
2025-02-27 16:39:08 +01:00
committed by GitHub
parent 0fb66076ba
commit 6c266acced
4 changed files with 59 additions and 3 deletions

View File

@@ -363,6 +363,26 @@ describe('Test PostgresV2, executeQuery operation', () => {
);
});
it('should execute queries with null key/value pairs', async () => {
const nodeParameters: IDataObject = {
operation: 'executeQuery',
query: 'SELECT *\nFROM users\nWHERE username IN ($1, $2)',
options: {
queryReplacement: '"={{ betty }}, {{ null }}"',
},
};
const nodeOptions = nodeParameters.options as IDataObject;
expect(async () => {
await executeQuery.execute.call(
createMockExecuteFunction(nodeParameters),
runQueries,
items,
nodeOptions,
);
}).not.toThrow();
});
it('should execute queries with multiple json key/value pairs', async () => {
const nodeParameters: IDataObject = {
operation: 'executeQuery',