Remove deprecated top level functions Get and Select

Signed-off-by: Michał Matczuk <michal@scylladb.com>
This commit is contained in:
Michał Matczuk
2020-01-17 14:41:56 +01:00
committed by Michal Jan Matczuk
parent 7c0a35d621
commit 710f921b79
3 changed files with 14 additions and 25 deletions

View File

@@ -69,17 +69,20 @@ func List(ctx context.Context, session *gocql.Session) ([]*Info, error) {
return nil, err
}
q := gocqlx.Query(session.Query(selectInfo).WithContext(ctx), nil)
var v []*Info
err := gocqlx.Select(&v, session.Query(selectInfo).WithContext(ctx))
if err == gocql.ErrNotFound {
if err := q.SelectRelease(&v); err == gocql.ErrNotFound {
return nil, nil
} else if err != nil {
return v, err
}
sort.Slice(v, func(i, j int) bool {
return v[i].Name < v[j].Name
})
return v, err
return v, nil
}
func ensureInfoTable(ctx context.Context, session *gocql.Session) error {