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
634 stars 90 forks source link

Query.Column(): populate the first column of the result into a slice. Error #21

Closed kolkov closed 8 years ago

kolkov commented 8 years ago

q.Column undefined (type *dbx.SelectQuery has no field or method Column) this works only for commented statement.

func (m *User)GetEmailsAll() []string {
    q := db.Select("email") //q := db.NewQuery("SELECT `email` FROM `users`")
    var emails []string
    q.Column(&emails)
    return emails
}
qiangxue commented 8 years ago

Fixed in https://github.com/go-ozzo/ozzo-dbx/commit/8eaf82754a91bf51dc20052205e602479214a9d7 Thanks!