mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
✨ Add type casting to postgres queries (#1600)
* 538 add support for casting types in postgres * Add typing to postgres insert nodes and removed unnecessary field from crate db * Added placeholder and description for types in postgres * Adding tests to insert and changes suggested by Ben * ⚡ Minor improvement Co-authored-by: mutdmour <mutdmour@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -107,22 +107,6 @@ export class QuestDb implements INodeType {
|
||||
required: true,
|
||||
description: 'Name of the table in which to insert data to.',
|
||||
},
|
||||
{
|
||||
displayName: 'Columns',
|
||||
name: 'columns',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'insert',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
placeholder: 'id,name,description',
|
||||
description:
|
||||
'Comma separated list of the properties which should used as columns for the new rows.',
|
||||
},
|
||||
{
|
||||
displayName: 'Return Fields',
|
||||
name: 'returnFields',
|
||||
@@ -194,7 +178,7 @@ export class QuestDb implements INodeType {
|
||||
}).join(',');
|
||||
|
||||
const query = `INSERT INTO ${tableName} (${columns.join(',')}) VALUES (${values});`;
|
||||
queries.push(query);
|
||||
queries.push(query);
|
||||
});
|
||||
|
||||
await db.any(pgp.helpers.concat(queries));
|
||||
|
||||
Reference in New Issue
Block a user