table: add GetQuery shortcut to Queryx

This commit is contained in:
Maciej Zimnoch authored and Michal Jan Matczuk committed 2020-06-19 11:13:21 +02:00
1 parent 4f4f94e2e6
commit 8af6506cde
1 file changed
+5
+5
View File
@@ -90,6 +90,11 @@ func (t *Table) Get(columns ...string) (stmt string, names []string) {
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.
func (t *Table) Select(columns ...string) (stmt string, names []string) {
if len(columns) == 0 {