Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
9ea2f9f6
Commit
9ea2f9f6
authored
Jul 23, 2025
by
johnnyjoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: linter
parent
ed23cbc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
common_converter.go
plugin/filter/common_converter.go
+17
-18
No files found.
plugin/filter/common_converter.go
View file @
9ea2f9f6
...
...
@@ -512,27 +512,26 @@ func (c *CommonSQLConverter) handleBooleanComparison(ctx *ConvertContext, field,
return
err
}
return
nil
}
else
{
// Other fields use IS TRUE / NOT(... IS TRUE)
var
sqlExpr
string
if
operator
==
"="
{
if
valueBool
{
sqlExpr
=
fmt
.
Sprintf
(
"%s IS TRUE"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
else
{
sqlExpr
=
fmt
.
Sprintf
(
"NOT(%s IS TRUE)"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
}
else
{
// operator == "!="
if
valueBool
{
sqlExpr
=
fmt
.
Sprintf
(
"NOT(%s IS TRUE)"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
else
{
sqlExpr
=
fmt
.
Sprintf
(
"%s IS TRUE"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
}
// Other fields use IS TRUE / NOT(... IS TRUE)
var
sqlExpr
string
if
operator
==
"="
{
if
valueBool
{
sqlExpr
=
fmt
.
Sprintf
(
"%s IS TRUE"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
else
{
sqlExpr
=
fmt
.
Sprintf
(
"NOT(%s IS TRUE)"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
if
_
,
err
:=
ctx
.
Buffer
.
WriteString
(
sqlExpr
);
err
!=
nil
{
return
err
}
else
{
// operator == "!="
if
valueBool
{
sqlExpr
=
fmt
.
Sprintf
(
"NOT(%s IS TRUE)"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
else
{
sqlExpr
=
fmt
.
Sprintf
(
"%s IS TRUE"
,
c
.
dialect
.
GetJSONExtract
(
jsonPath
))
}
return
nil
}
if
_
,
err
:=
ctx
.
Buffer
.
WriteString
(
sqlExpr
);
err
!=
nil
{
return
err
}
return
nil
}
// Special handling for MySQL - use raw operator with CAST
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment