Skip to content

Commit 8af6506

Browse files
zimnxmmatczuk
authored andcommitted
table: add GetQuery shortcut to Queryx
1 parent 4f4f94e commit 8af6506

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

table/table.go

+5
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ func (t *Table) Get(columns ...string) (stmt string, names []string) {
9090
ToCql()
9191
}
9292

93+
// GetQuery returns query which gets by partition key.
94+
func (t *Table) GetQuery(session gocqlx.Session, columns ...string) *gocqlx.Queryx {
95+
return session.Query(t.Get(columns...))
96+
}
97+
9398
// Select returns select by partition key statement.
9499
func (t *Table) Select(columns ...string) (stmt string, names []string) {
95100
if len(columns) == 0 {

0 commit comments

Comments
 (0)