goqu
goqu copied to clipboard
SqlServer dialect and table hint `With (NOLOCK)`
Is your feature request related to a problem? Please describe. How can I use table hints with sqlserver dialect?
Describe the solution you'd like
I would like to create a SQL with (nolock)
table hint, something like:
qb := goqu.Dialect("sqlserver")
ds := qb.From("test").Hint("NOLOCK").Where(goqu.Ex{"id": 10})
sql, args, err := ds.ToSql()
if err != nil {
panic(err)
}
fmt.Println(sql, args)
SELECT * FROM "test" WITH (NOLOCK) WHERE ("id" = 10) []
Describe alternatives you've considered
Dialect
- [ ] postgres
- [ ] mysql
- [ ] sqlite3
- [X] sqlserver
Additional context About Table Hints