We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我尝试着复制JSONQuery代码自己修改NotEquals,发现gorm框架里面有各种各样的类型限制,导致我没法直接设计自己的NotEquals 所以希望架构能支持JSONQuery.NotEquals, 或者说至少支持我自定义实现JSONQuery等部类型的相关Condition接口
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: conds = append(conds, &condContainer{value: e}) default: conds = append(conds, &condContainer{err: fmt.Errorf("unsupported Expression %T to converted to Condition", e)}) } } return conds } func condToExpression(conds []Condition) ([]clause.Expression, error) { if len(conds) == 0 { return nil, nil } exprs := make([]clause.Expression, 0, len(conds)) for _, cond := range conds { if cond == nil { continue } if err := cond.CondError(); err != nil { return nil, err } switch cond.(type) { case *condContainer, field.Expr, SubQuery: default: return nil, fmt.Errorf("unsupported condition: %+v", cond) } switch e := cond.BeCond().(type) { case []clause.Expression: exprs = append(exprs, e...) case clause.Expression: exprs = append(exprs, e) } } return exprs, nil }
The text was updated successfully, but these errors were encountered:
jinzhu
No branches or pull requests
我尝试着复制JSONQuery代码自己修改NotEquals,发现gorm框架里面有各种各样的类型限制,导致我没法直接设计自己的NotEquals
所以希望架构能支持JSONQuery.NotEquals, 或者说至少支持我自定义实现JSONQuery等部类型的相关Condition接口
Motivation
Related Issues
The text was updated successfully, but these errors were encountered: