Getting issue while making dynamic query for where clause My dynamic query string is like this where("table1.col1 = ? AND table2.col2= ?") but this is not working when i place this string in Where function of gorm, it gets replaced by table1.col1 = ?,? AND table.col2= ?

and this is basically breaking the query and giving error

Don't know how this extra ? is appended in my final queryExpression got from gorm.

The document you expected this should be explained

Expected answer

Expected answer is it shouldn't append any ? mark on the passed dynamic query in gorm Where function.

Comment From: ghost

@sagg1295-swiggy hello,can you provide a demo in https://github.com/go-gorm/playground?

Comment From: li-jin-gou

hello, you can use scope in https://gorm.io/zh_CN/docs/scopes.html @sagg1295-swiggy