fix query order when using ttl and unique

This commit is contained in:
Eric Renard
2017-12-27 16:19:38 +01:00
committed by Michał Matczuk
parent ca0bd49565
commit 9fa5432a65

View File

@@ -45,11 +45,10 @@ func (b *InsertBuilder) ToCql() (stmt string, names []string) {
placeholders(&cql, len(b.columns))
cql.WriteString(") ")
names = append(names, b.using.writeCql(&cql)...)
if b.unique {
cql.WriteString("IF NOT EXISTS ")
}
names = append(names, b.using.writeCql(&cql)...)
stmt = cql.String()
return