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
错误信息: Query: SELECT * FROM "pwdinfo" WHERE (password=?); Args: []interface {}{"123"} Error: pq: 操作符不存在: character varying =? Time: 1.02744s 源码: pwd:=c.QueryParam("pwd") pwdinfo:= &models.Pwdinfo{} err:= gosql.Model(pwdinfo).Where("password=?",pwd).Get() if err!=nil{ log.Println(err.Error()) }
pwd:=c.QueryParam("pwd") pwdinfo:= &models.Pwdinfo{} err:= gosql.Model(pwdinfo).Where("password=?",pwd).Get() if err!=nil{ log.Println(err.Error()) }
The text was updated successfully, but these errors were encountered:
查阅了sqlx的文档,发现对postgresql的通配符使用方式不同, err:= gosql.Model(pwdinfo).Where("enabled=1 and password=$1",pwd).Get() 使用$1代替?可正常查询 但是如果直接将参数放在model中,因为orm默认会替换成? 所以仍然返回上述错误,希望在后续版本中可以解决此兼容问题,谢谢!
err:= gosql.Model(pwdinfo).Where("enabled=1 and password=$1",pwd).Get()
Sorry, something went wrong.
fix: support postgres where placeholder #46
ba5bcb8
No branches or pull requests
错误信息:
Query: SELECT * FROM "pwdinfo" WHERE (password=?);
Args: []interface {}{"123"}
Error: pq: 操作符不存在: character varying =?
Time: 1.02744s
源码:
pwd:=c.QueryParam("pwd") pwdinfo:= &models.Pwdinfo{} err:= gosql.Model(pwdinfo).Where("password=?",pwd).Get() if err!=nil{ log.Println(err.Error()) }
The text was updated successfully, but these errors were encountered: