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
go-gorm/playground#791
the mysql column area type is json;
here is a simple code in golang;
var vals []interface{} vals = append(vals, 1) vals = append(vals, 2) scopes = append(scopes, gen.Cond(datatypes.JSONArrayQuery("area").Contains(vals))...)
the sql build in mysql is SELECT count(*) FROM kec WHERE JSON_CONTAINS (area, JSON_ARRAY((1,2))) ;(1241 - Operand should contain 1 column(s))
if there is none extra parentheses SELECT count(*) FROM kec WHERE JSON_CONTAINS (area, JSON_ARRAY(1,2)) ; successful
The text was updated successfully, but these errors were encountered:
jinzhu
No branches or pull requests
GORM Playground Link
go-gorm/playground#791
Description
the mysql column area type is json;
here is a simple code in golang;
var vals []interface{}
vals = append(vals, 1)
vals = append(vals, 2)
scopes = append(scopes, gen.Cond(datatypes.JSONArrayQuery("area").Contains(vals))...)
the sql build in mysql is
SELECT count(*) FROM kec WHERE JSON_CONTAINS (area, JSON_ARRAY((1,2))) ;(1241 - Operand should contain 1 column(s))
if there is none extra parentheses
SELECT count(*) FROM kec WHERE JSON_CONTAINS (area, JSON_ARRAY(1,2)) ; successful
The text was updated successfully, but these errors were encountered: