Skip to content

Commit 75a8eb5

Browse files
committed
fix #45
1 parent 3b24ddc commit 75a8eb5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/clj/qbits/hayt/cql.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@
692692
(cond->
693693
(not logged) (str! " UNLOGGED")
694694
counter (str! " COUNTER"))
695-
(str! " BATCH")
695+
(str! " BATCH ")
696696
(cond->
697697
using (-> ((emit :using) q using)
698698
(str! " \n")))

test/qbits/hayt/core_test.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288

289289
(deftest test-batch
290290
(are-raw
291-
"BEGIN BATCH USING TIMESTAMP 2134 \nUPDATE foo SET bar = 1, baz = baz + 2;\nINSERT INTO foo (\"a\", \"c\") VALUES ('b', 'd') USING TIMESTAMP 100000 AND TTL 200000;\n APPLY BATCH;"
291+
"BEGIN BATCH USING TIMESTAMP 2134 \nUPDATE foo SET bar = 1, baz = baz + 2;\nINSERT INTO foo (\"a\", \"c\") VALUES ('b', 'd') USING TIMESTAMP 100000 AND TTL 200000;\n APPLY BATCH;"
292292
(batch
293293
(queries
294294
nil
@@ -301,7 +301,10 @@
301301
:ttl 200000)))
302302
(using :timestamp 2134))
303303

304-
"BEGIN UNLOGGED BATCH USING TIMESTAMP 2134 \nUPDATE foo SET bar = 1, baz = baz + 2;\nINSERT INTO foo (\"a\", \"c\") VALUES ('b', 'd') USING TIMESTAMP 100000 AND TTL 200000;\n APPLY BATCH;"
304+
"BEGIN UNLOGGED BATCH INSERT INTO table (col) VALUES (1);\n APPLY BATCH;"
305+
{:batch [{:insert :table, :values {:col 1}}]}
306+
307+
"BEGIN UNLOGGED BATCH USING TIMESTAMP 2134 \nUPDATE foo SET bar = 1, baz = baz + 2;\nINSERT INTO foo (\"a\", \"c\") VALUES ('b', 'd') USING TIMESTAMP 100000 AND TTL 200000;\n APPLY BATCH;"
305308
(batch
306309
(queries
307310
(update :foo

0 commit comments

Comments
 (0)