expose SelectBuilder for table Get operation (#251)
* expose select builder for get * add comment
This commit is contained in:
@@ -102,6 +102,15 @@ func (t *Table) GetQueryContext(ctx context.Context, session gocqlx.Session, col
|
||||
return t.GetQuery(session, columns...).WithContext(ctx)
|
||||
}
|
||||
|
||||
// GetBuilder returns a builder initialised to select by primary key
|
||||
func (t *Table) GetBuilder(columns ...string) *qb.SelectBuilder {
|
||||
if len(columns) == 0 {
|
||||
return qb.Select(t.metadata.Name).Where(t.primaryKeyCmp...)
|
||||
}
|
||||
|
||||
return qb.Select(t.metadata.Name).Columns(columns...).Where(t.primaryKeyCmp...)
|
||||
}
|
||||
|
||||
// Select returns select by partition key statement.
|
||||
func (t *Table) Select(columns ...string) (stmt string, names []string) {
|
||||
if len(columns) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user