field IsNull, IsNotNull methods

This commit is contained in:
2025-08-03 21:41:20 +05:30
parent 6c14441591
commit 096480a3eb
3 changed files with 20 additions and 5 deletions

12
qry.go
View File

@@ -208,12 +208,16 @@ func (cv *Cond) Condition(args *[]any, argIdx int) string {
}
// 2. normal condition
*args = append(*args, cv.Val)
var op string
if strings.HasSuffix(cv.op, "$") {
op = cv.op + strconv.Itoa(argIdx+1)
if cv.Val != nil {
*args = append(*args, cv.Val)
if strings.HasSuffix(cv.op, "$") {
op = cv.op + strconv.Itoa(argIdx+1)
} else {
op = strings.Replace(cv.op, "$", "$"+strconv.Itoa(argIdx+1), 1)
}
} else {
op = strings.Replace(cv.op, "$", "$"+strconv.Itoa(argIdx+1), 1)
op = cv.op
}
if cv.action == CondActionNeedToClose {