mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Postgres Node): Option to treat query parameters enclosed in single quotas as text (#10214)
This commit is contained in:
@@ -109,6 +109,16 @@ export async function execute(
|
||||
}
|
||||
}
|
||||
|
||||
if (!queryReplacement || nodeOptions.treatQueryParametersInSingleQuotesAsText) {
|
||||
let nextValueIndex = values.length + 1;
|
||||
const literals = query.match(/'\$[0-9]+'/g) ?? [];
|
||||
for (const literal of literals) {
|
||||
query = query.replace(literal, `$${nextValueIndex}`);
|
||||
values.push(literal.replace(/'/g, ''));
|
||||
nextValueIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
queries.push({ query, values });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user