mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
⚡ Small improvements to CrateDb-Node
This commit is contained in:
parent
6a8d22d2fa
commit
7d2f225a21
|
@ -1,10 +1,19 @@
|
|||
import { IExecuteFunctions } from 'n8n-core';
|
||||
import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
||||
import {
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
getItemCopy,
|
||||
pgInsert,
|
||||
pgQuery,
|
||||
} from '../Postgres/Postgres.node.functions';
|
||||
|
||||
import * as pgPromise from 'pg-promise';
|
||||
|
||||
import { pgInsert, pgQuery, pgUpdate, getItemCopy } from '../Postgres/Postgres.node.functions';
|
||||
|
||||
export class CrateDb implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'CrateDB',
|
||||
|
@ -254,7 +263,7 @@ export class CrateDb implements INodeType {
|
|||
|
||||
if (updateKeyValue === undefined) {
|
||||
throw new Error('No value found for update key!');
|
||||
}
|
||||
}
|
||||
|
||||
updatedKeys.push(updateKeyValue as string);
|
||||
|
||||
|
@ -262,9 +271,9 @@ export class CrateDb implements INodeType {
|
|||
queries.push(query);
|
||||
});
|
||||
|
||||
|
||||
|
||||
await db.any(pgp.helpers.concat(queries));
|
||||
|
||||
|
||||
returnItems = this.helpers.returnJsonArray(getItemCopy(items, columns) as IDataObject[]);
|
||||
} else {
|
||||
await pgp.end();
|
||||
|
|
Loading…
Reference in a new issue