mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fixed datetime null condition #356
This commit is contained in:
parent
c9a9c7d0f7
commit
5b8d70747f
@ -181,10 +181,23 @@ const binaryCondition = operator => value => ({
|
||||
},
|
||||
});
|
||||
|
||||
const unaryCondition = conditionType => () => {
|
||||
return {
|
||||
conditionType,
|
||||
expr: {
|
||||
exprType: 'placeholder',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const createParser = () => {
|
||||
const langDef = {
|
||||
comma: () => word(','),
|
||||
|
||||
not: () => word('NOT'),
|
||||
notNull: r => r.not.then(r.null).map(unaryCondition('isNotNull')),
|
||||
null: () => word('NULL').map(unaryCondition('isNull')),
|
||||
|
||||
yearNum: () => P.regexp(/\d\d\d\d/).map(yearCondition()),
|
||||
yearMonthNum: () => P.regexp(/\d\d\d\d-\d\d?/).map(yearMonthCondition()),
|
||||
yearMonthDayNum: () => P.regexp(/\d\d\d\d-\d\d?-\d\d?/).map(yearMonthDayCondition()),
|
||||
@ -264,6 +277,8 @@ const createParser = () => {
|
||||
r.lastYear,
|
||||
r.thisYear,
|
||||
r.nextYear,
|
||||
r.null,
|
||||
r.notNull,
|
||||
r.le,
|
||||
r.lt,
|
||||
r.ge,
|
||||
|
Loading…
Reference in New Issue
Block a user