mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
fix(Postgres Node): Convert js arrays to postgres type, if column type is ARRAY (#9160)
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
configureTableSchemaUpdater,
|
||||
getTableSchema,
|
||||
prepareItem,
|
||||
convertArraysToPostgresFormat,
|
||||
replaceEmptyStringsByNulls,
|
||||
} from '../../helpers/utils';
|
||||
|
||||
@@ -135,7 +136,7 @@ const properties: INodeProperties[] = [
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [2.2, 2.3],
|
||||
'@version': [{ _cnd: { gte: 2.2 } }],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -224,6 +225,10 @@ export async function execute(
|
||||
|
||||
tableSchema = await updateTableSchema(db, tableSchema, schema, table);
|
||||
|
||||
if (nodeVersion >= 2.4) {
|
||||
convertArraysToPostgresFormat(item, tableSchema, this.getNode(), i);
|
||||
}
|
||||
|
||||
values.push(checkItemAgainstSchema(this.getNode(), item, tableSchema, i));
|
||||
|
||||
const outputColumns = this.getNodeParameter('options.outputColumns', i, ['*']) as string[];
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
doesRowExist,
|
||||
getTableSchema,
|
||||
prepareItem,
|
||||
convertArraysToPostgresFormat,
|
||||
replaceEmptyStringsByNulls,
|
||||
} from '../../helpers/utils';
|
||||
|
||||
@@ -172,7 +173,7 @@ const properties: INodeProperties[] = [
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [2.2, 2.3],
|
||||
'@version': [{ _cnd: { gte: 2.2 } }],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -301,6 +302,10 @@ export async function execute(
|
||||
|
||||
tableSchema = await updateTableSchema(db, tableSchema, schema, table);
|
||||
|
||||
if (nodeVersion >= 2.4) {
|
||||
convertArraysToPostgresFormat(item, tableSchema, this.getNode(), i);
|
||||
}
|
||||
|
||||
item = checkItemAgainstSchema(this.getNode(), item, tableSchema, i);
|
||||
|
||||
let values: QueryValues = [schema, table];
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
prepareItem,
|
||||
replaceEmptyStringsByNulls,
|
||||
configureTableSchemaUpdater,
|
||||
convertArraysToPostgresFormat,
|
||||
} from '../../helpers/utils';
|
||||
|
||||
import { optionsCollection } from '../common.descriptions';
|
||||
@@ -171,7 +172,7 @@ const properties: INodeProperties[] = [
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [2.2, 2.3],
|
||||
'@version': [{ _cnd: { gte: 2.2 } }],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -270,6 +271,10 @@ export async function execute(
|
||||
|
||||
tableSchema = await updateTableSchema(db, tableSchema, schema, table);
|
||||
|
||||
if (nodeVersion >= 2.4) {
|
||||
convertArraysToPostgresFormat(item, tableSchema, this.getNode(), i);
|
||||
}
|
||||
|
||||
item = checkItemAgainstSchema(this.getNode(), item, tableSchema, i);
|
||||
|
||||
let values: QueryValues = [schema, table];
|
||||
|
||||
Reference in New Issue
Block a user