qb: using ttl timestamp

Fixes: #40
This commit is contained in:
Michał Matczuk
2018-05-25 13:06:43 +02:00
parent e8ffe4afe9
commit fa402f3f0c
15 changed files with 351 additions and 136 deletions

View File

@@ -9,6 +9,7 @@ package qb
import (
"bytes"
"time"
)
// DeleteBuilder builds CQL DELETE statements.
@@ -65,9 +66,16 @@ func (b *DeleteBuilder) Columns(columns ...string) *DeleteBuilder {
return b
}
// Timestamp sets a USING TIMESTAMP clause on the query.
func (b *DeleteBuilder) Timestamp() *DeleteBuilder {
b.using.timestamp = true
// Timestamp adds USING TIMESTAMP clause to the query.
func (b *DeleteBuilder) Timestamp(t time.Time) *DeleteBuilder {
b.using.Timestamp(t)
return b
}
// TimestampNamed adds a USING TIMESTAMP clause to the query with a custom
// parameter name.
func (b *DeleteBuilder) TimestampNamed(name string) *DeleteBuilder {
b.using.TimestampNamed(name)
return b
}