Skip to content

Commit

Permalink
feat: condition accept json.JSONArrayExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r committed Feb 13, 2023
1 parent 7eed555 commit 6dc1af4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 47 deletions.
2 changes: 1 addition & 1 deletion condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func exprToCondition(exprs ...clause.Expression) []Condition {
conds := make([]Condition, 0, len(exprs))
for _, e := range exprs {
switch e := e.(type) {
case *datatypes.JSONQueryExpression, *datatypes.JSONOverlapsExpression:
case *datatypes.JSONQueryExpression, *datatypes.JSONOverlapsExpression, *datatypes.JSONArrayExpression:
conds = append(conds, &condContainer{value: e})
default:
conds = append(conds, &condContainer{err: fmt.Errorf("unsupported Expression %T to converted to Condition", e)})
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ go 1.18
require (
golang.org/x/tools v0.1.12
gopkg.in/yaml.v3 v3.0.1
gorm.io/datatypes v1.0.7
gorm.io/driver/mysql v1.4.0
gorm.io/driver/postgres v1.4.1
gorm.io/driver/sqlite v1.4.1
gorm.io/driver/sqlserver v1.4.0
gorm.io/gorm v1.24.0
gorm.io/datatypes v1.1.1-0.20230130040222-c43177d3cf8c
gorm.io/driver/mysql v1.4.4
gorm.io/driver/postgres v1.4.5
gorm.io/driver/sqlite v1.4.3
gorm.io/driver/sqlserver v1.4.1
gorm.io/gorm v1.24.2
gorm.io/hints v1.1.0
gorm.io/plugin/dbresolver v1.3.0
)

require (
github.com/denisenkom/go-mssqldb v0.12.2 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
Expand All @@ -31,6 +30,7 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/mattn/go-sqlite3 v1.14.15 // indirect
github.com/microsoft/go-mssqldb v0.17.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
Expand Down
Loading

0 comments on commit 6dc1af4

Please sign in to comment.