qb: TTL and Timestamp named parameters

This commit is contained in:
Michał Matczuk
2017-08-01 12:44:10 +02:00
parent ab0839a9d1
commit 906f9433fe
9 changed files with 72 additions and 53 deletions

View File

@@ -5,7 +5,6 @@ package qb
import (
"bytes"
"time"
)
// DeleteBuilder builds CQL DELETE statements.
@@ -38,8 +37,7 @@ func (b *DeleteBuilder) ToCql() (stmt string, names []string) {
cql.WriteString(b.table)
cql.WriteByte(' ')
b.using.writeCql(&cql)
names = append(names, b.using.writeCql(&cql)...)
names = append(names, b.where.writeCql(&cql)...)
names = append(names, b._if.writeCql(&cql)...)
@@ -64,8 +62,8 @@ func (b *DeleteBuilder) Columns(columns ...string) *DeleteBuilder {
}
// Timestamp sets a USING TIMESTAMP clause on the query.
func (b *DeleteBuilder) Timestamp(t time.Time) *DeleteBuilder {
b.using.timestamp = t
func (b *DeleteBuilder) Timestamp() *DeleteBuilder {
b.using.timestamp = true
return b
}