mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Move copyInputItems to node helpers (no-changelog) (#7299)
This commit is contained in:
committed by
GitHub
parent
34bda535e6
commit
597669aa62
@@ -6,7 +6,7 @@ import type {
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { connect, copyInputItems, destroy, execute } from './GenericFunctions';
|
||||
import { connect, destroy, execute } from './GenericFunctions';
|
||||
|
||||
import snowflake from 'snowflake-sdk';
|
||||
import { getResolvables } from '@utils/utilities';
|
||||
@@ -207,7 +207,7 @@ export class Snowflake implements INodeType {
|
||||
const query = `INSERT INTO ${table}(${columns.join(',')}) VALUES (${columns
|
||||
.map((_column) => '?')
|
||||
.join(',')})`;
|
||||
const data = copyInputItems(items, columns);
|
||||
const data = this.helpers.copyInputItems(items, columns);
|
||||
const binds = data.map((element) => Object.values(element));
|
||||
await execute(connection, query, binds as unknown as snowflake.InsertBinds);
|
||||
data.forEach((d, i) => {
|
||||
@@ -236,7 +236,7 @@ export class Snowflake implements INodeType {
|
||||
const query = `UPDATE ${table} SET ${columns
|
||||
.map((column) => `${column} = ?`)
|
||||
.join(',')} WHERE ${updateKey} = ?;`;
|
||||
const data = copyInputItems(items, columns);
|
||||
const data = this.helpers.copyInputItems(items, columns);
|
||||
const binds = data.map((element) => Object.values(element).concat(element[updateKey]));
|
||||
for (let i = 0; i < binds.length; i++) {
|
||||
await execute(connection, query, binds[i] as unknown as snowflake.InsertBinds);
|
||||
|
||||
Reference in New Issue
Block a user