From 8af6506cde90c1c1922a38653f97ecb525755801 Mon Sep 17 00:00:00 2001 From: Maciej Zimnoch Date: Wed, 17 Jun 2020 16:54:58 +0200 Subject: [PATCH] table: add GetQuery shortcut to Queryx --- table/table.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/table/table.go b/table/table.go index 91555d4..72dddfe 100644 --- a/table/table.go +++ b/table/table.go @@ -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 {