Skip to content

Commit

Permalink
fix(Postgres Node): Fix automatic column mapping (#7121)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored Sep 6, 2023
1 parent 36a8e91 commit 92af131
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions packages/nodes-base/nodes/Postgres/test/v2/operations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('Test PostgresV2, deleteTable operation', () => {
},
],
},
options: { typeVersion: 2.1 },
options: { nodeVersion: 2.1 },
};
const nodeOptions = nodeParameters.options as IDataObject;

Expand Down Expand Up @@ -168,7 +168,7 @@ describe('Test PostgresV2, deleteTable operation', () => {
cachedResultName: 'my_table',
},
deleteCommand: 'drop',
options: { typeVersion: 2.1 },
options: { nodeVersion: 2.1 },
};
const nodeOptions = nodeParameters.options as IDataObject;

Expand Down Expand Up @@ -256,7 +256,7 @@ describe('Test PostgresV2, insert operation', () => {
},
],
},
options: { typeVersion: 2.1 },
options: { nodeVersion: 2.1 },
};
const columnsInfo: ColumnInfo[] = [
{ column_name: 'id', data_type: 'integer', is_nullable: 'NO', udt_name: '' },
Expand Down Expand Up @@ -299,7 +299,7 @@ describe('Test PostgresV2, insert operation', () => {
mode: 'list',
},
dataMode: 'autoMapInputData',
options: { typeVersion: 2.1 },
options: { nodeVersion: 2.1 },
};
const columnsInfo: ColumnInfo[] = [
{ column_name: 'id', data_type: 'integer', is_nullable: 'NO', udt_name: '' },
Expand Down Expand Up @@ -509,7 +509,7 @@ describe('Test PostgresV2, update operation', () => {
},
options: {
outputColumns: ['json', 'foo'],
typeVersion: 2.1,
nodeVersion: 2.1,
},
};
const columnsInfo: ColumnInfo[] = [
Expand Down Expand Up @@ -566,7 +566,7 @@ describe('Test PostgresV2, update operation', () => {
},
dataMode: 'autoMapInputData',
columnToMatchOn: 'id',
options: { typeVersion: 2.1 },
options: { nodeVersion: 2.1 },
};
const columnsInfo: ColumnInfo[] = [
{ column_name: 'id', data_type: 'integer', is_nullable: 'NO', udt_name: '' },
Expand Down Expand Up @@ -669,7 +669,7 @@ describe('Test PostgresV2, upsert operation', () => {
},
options: {
outputColumns: ['json'],
typeVersion: 2.1,
nodeVersion: 2.1,
},
};
const columnsInfo: ColumnInfo[] = [
Expand Down Expand Up @@ -726,7 +726,7 @@ describe('Test PostgresV2, upsert operation', () => {
},
dataMode: 'autoMapInputData',
columnToMatchOn: 'id',
options: { typeVersion: 2.1 },
options: { nodeVersion: 2.1 },
};
const columnsInfo: ColumnInfo[] = [
{ column_name: 'id', data_type: 'integer', is_nullable: 'NO', udt_name: '' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export async function execute(
db: PgpDatabase,
): Promise<INodeExecutionData[]> {
items = replaceEmptyStringsByNulls(items, nodeOptions.replaceEmptyStrings as boolean);
const nodeVersion = nodeOptions.typeVersion as number;
const nodeVersion = nodeOptions.nodeVersion as number;

let schema = this.getNodeParameter('schema', 0, undefined, {
extractValue: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export async function execute(
db: PgpDatabase,
): Promise<INodeExecutionData[]> {
items = replaceEmptyStringsByNulls(items, nodeOptions.replaceEmptyStrings as boolean);
const nodeVersion = nodeOptions.typeVersion as number;
const nodeVersion = nodeOptions.nodeVersion as number;

let schema = this.getNodeParameter('schema', 0, undefined, {
extractValue: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export async function execute(
db: PgpDatabase,
): Promise<INodeExecutionData[]> {
items = replaceEmptyStringsByNulls(items, nodeOptions.replaceEmptyStrings as boolean);
const nodeVersion = nodeOptions.typeVersion as number;
const nodeVersion = nodeOptions.nodeVersion as number;

let schema = this.getNodeParameter('schema', 0, undefined, {
extractValue: true,
Expand Down

0 comments on commit 92af131

Please sign in to comment.