Skip to content

Commit 6dc1af4

Browse files
committed
feat: condition accept json.JSONArrayExpression
1 parent 7eed555 commit 6dc1af4

File tree

3 files changed

+50
-47
lines changed

3 files changed

+50
-47
lines changed

condition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func exprToCondition(exprs ...clause.Expression) []Condition {
2727
conds := make([]Condition, 0, len(exprs))
2828
for _, e := range exprs {
2929
switch e := e.(type) {
30-
case *datatypes.JSONQueryExpression, *datatypes.JSONOverlapsExpression:
30+
case *datatypes.JSONQueryExpression, *datatypes.JSONOverlapsExpression, *datatypes.JSONArrayExpression:
3131
conds = append(conds, &condContainer{value: e})
3232
default:
3333
conds = append(conds, &condContainer{err: fmt.Errorf("unsupported Expression %T to converted to Condition", e)})

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ go 1.18
55
require (
66
golang.org/x/tools v0.1.12
77
gopkg.in/yaml.v3 v3.0.1
8-
gorm.io/datatypes v1.0.7
9-
gorm.io/driver/mysql v1.4.0
10-
gorm.io/driver/postgres v1.4.1
11-
gorm.io/driver/sqlite v1.4.1
12-
gorm.io/driver/sqlserver v1.4.0
13-
gorm.io/gorm v1.24.0
8+
gorm.io/datatypes v1.1.1-0.20230130040222-c43177d3cf8c
9+
gorm.io/driver/mysql v1.4.4
10+
gorm.io/driver/postgres v1.4.5
11+
gorm.io/driver/sqlite v1.4.3
12+
gorm.io/driver/sqlserver v1.4.1
13+
gorm.io/gorm v1.24.2
1414
gorm.io/hints v1.1.0
1515
gorm.io/plugin/dbresolver v1.3.0
1616
)
1717

1818
require (
19-
github.com/denisenkom/go-mssqldb v0.12.2 // indirect
20-
github.com/go-sql-driver/mysql v1.6.0 // indirect
19+
github.com/go-sql-driver/mysql v1.7.0 // indirect
2120
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
2221
github.com/golang-sql/sqlexp v0.1.0 // indirect
2322
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
@@ -31,6 +30,7 @@ require (
3130
github.com/jinzhu/inflection v1.0.0 // indirect
3231
github.com/jinzhu/now v1.1.5 // indirect
3332
github.com/mattn/go-sqlite3 v1.14.15 // indirect
33+
github.com/microsoft/go-mssqldb v0.17.0 // indirect
3434
github.com/pkg/errors v0.9.1 // indirect
3535
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b // indirect
3636
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect

0 commit comments

Comments
 (0)