table: add GetQuery shortcut to Queryx
This commit is contained in:
committed by
Michal Jan Matczuk
parent
4f4f94e2e6
commit
8af6506cde
@@ -90,6 +90,11 @@ func (t *Table) Get(columns ...string) (stmt string, names []string) {
|
|||||||
ToCql()
|
ToCql()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetQuery returns query which gets by partition key.
|
||||||
|
func (t *Table) GetQuery(session gocqlx.Session, columns ...string) *gocqlx.Queryx {
|
||||||
|
return session.Query(t.Get(columns...))
|
||||||
|
}
|
||||||
|
|
||||||
// Select returns select by partition key statement.
|
// Select returns select by partition key statement.
|
||||||
func (t *Table) Select(columns ...string) (stmt string, names []string) {
|
func (t *Table) Select(columns ...string) (stmt string, names []string) {
|
||||||
if len(columns) == 0 {
|
if len(columns) == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user