feat(Postgres Node): Add option IS NOT NULL and hide value input fields (#9241)

This commit is contained in:
aya 2024-05-02 11:08:57 +02:00 committed by GitHub
parent ddff80416d
commit e896889394
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 2 deletions

View file

@ -279,6 +279,10 @@ export const selectRowsFixedCollection: INodeProperties = {
name: 'Is Null',
value: 'IS NULL',
},
{
name: 'Is Not Null',
value: 'IS NOT NULL',
},
],
default: 'equal',
},
@ -286,6 +290,11 @@ export const selectRowsFixedCollection: INodeProperties = {
displayName: 'Value',
name: 'value',
type: 'string',
displayOptions: {
hide: {
condition: ['IS NULL', 'IS NOT NULL'],
},
},
default: '',
},
],

View file

@ -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);
}

View file

@ -263,6 +263,10 @@ export const whereFixedCollection: INodeProperties = {
name: 'Is Null',
value: 'IS NULL',
},
{
name: 'Is Not Null',
value: 'IS NOT NULL',
},
],
default: 'equal',
},
@ -270,6 +274,11 @@ export const whereFixedCollection: INodeProperties = {
displayName: 'Value',
name: 'value',
type: 'string',
displayOptions: {
hide: {
condition: ['IS NULL', 'IS NOT NULL'],
},
},
default: '',
},
],

View file

@ -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;