Skip to content

Commit

Permalink
table: add GetQuery shortcut to Queryx
Browse files Browse the repository at this point in the history
  • Loading branch information
zimnx authored and mmatczuk committed Jun 19, 2020
1 parent 4f4f94e commit 8af6506
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8af6506

Please sign in to comment.