db
db copied to clipboard
Way to modify RawSQL?
This is my code in below, I want to append the where cond to my rawsql is it possible? or convert statement type to selector type? thx!
stat := exql.RawSQL("select * from table")
stat.Where = exql.WhereConditions() // how to? select * from table where id = 1
log.Println(stat.SQL)
sorry for ping.. @xiam
@whisper-bye this is currently not possible and exql
is an internal package. Would the sqlbuilder package work for your case? https://upper.io/db.v3/lib/sqlbuilder
@xiam in my case, I should generate sql from a raw sql, then insert some conditions in it
@whisper-bye Maybe we'll need to rewrite the query. Which database are you using? Could you provide an example of the full query?
@xiam psql only, I just need some way to modify raw sql with conditions