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:
Omar Ajoue
2021-04-03 16:53:47 +02:00
committed by GitHub
parent 3b00c96643
commit f225bbbb84
5 changed files with 193 additions and 33 deletions

View File

@@ -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));