go-ozzo / ozzo-dbx

A Go (golang) package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities.
MIT License
636 stars 91 forks source link

dbx.In() when data arrives in slice. #28

Closed kolkov closed 7 years ago

kolkov commented 7 years ago

Hi! How to use dbx.In() expression when data arrives in the slice like this: []string{"read", "unread"}

qiangxue commented 7 years ago

dbx.In("column", values...) ?

kolkov commented 7 years ago

And how to use this? Provide some examples please...

qiangxue commented 7 years ago

See https://github.com/go-ozzo/ozzo-dbx#read Replace dbx.HashExp with dbx.In

kolkov commented 7 years ago

Like this? statuses := []interface{}{"read", "unread"}

.Where(dbx.In("status", statuses...))

right?

qiangxue commented 7 years ago

yes