Skip to content

Commit

Permalink
feat(Postgres Node): Add option IS NOT NULL and hide value input fiel…
Browse files Browse the repository at this point in the history
…ds (#9241)
  • Loading branch information
ayatnkw authored May 2, 2024
1 parent ddff804 commit e896889
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,22 @@ export const selectRowsFixedCollection: INodeProperties = {
name: 'Is Null',
value: 'IS NULL',
},
{
name: 'Is Not Null',
value: 'IS NOT NULL',
},
],
default: 'equal',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
displayOptions: {
hide: {
condition: ['IS NULL', 'IS NOT NULL'],
},
},
default: '',
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/MySql/v2/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ export function addWhereClauses(
}

let valueReplacement = ' ';
if (clause.condition !== 'IS NULL') {
if (clause.condition !== 'IS NULL' && clause.condition !== 'IS NOT NULL') {
valueReplacement = ' ?';
values.push(clause.value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,22 @@ export const whereFixedCollection: INodeProperties = {
name: 'Is Null',
value: 'IS NULL',
},
{
name: 'Is Not Null',
value: 'IS NOT NULL',
},
],
default: 'equal',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
displayOptions: {
hide: {
condition: ['IS NULL', 'IS NOT NULL'],
},
},
default: '',
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Postgres/v2/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function addWhereClauses(
replacementIndex = replacementIndex + 1;

let valueReplacement = '';
if (clause.condition !== 'IS NULL') {
if (clause.condition !== 'IS NULL' && clause.condition !== 'IS NOT NULL') {
valueReplacement = ` $${replacementIndex}`;
values.push(clause.value);
replacementIndex = replacementIndex + 1;
Expand Down

0 comments on commit e896889

Please sign in to comment.