|
|
|
@ -27,10 +27,24 @@
|
|
|
|
|
|
|
|
|
|
(test "returning"
|
|
|
|
|
"INSERT INTO widgets VALUES ('foo', 'bar') RETURNING id, name"
|
|
|
|
|
(ssql->sql #t '(insert (into widgets) (values ("foo" "bar")) (returning id name))))
|
|
|
|
|
(ssql->sql #t '(insert (into widgets) (values #("foo" "bar")) (returning id name))))
|
|
|
|
|
|
|
|
|
|
(test "compose returning"
|
|
|
|
|
'(insert (into widgets) (values (1 2 3)) (returning id))
|
|
|
|
|
(ssql-compose #t '(insert (into widgets) (values (1 2 3))) '((returning id)))))
|
|
|
|
|
'(insert (into widgets) (values #(1 2 3)) (returning id))
|
|
|
|
|
(ssql-compose #t '(insert (into widgets) (values #(1 2 3))) '((returning id)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(test-group "arrays"
|
|
|
|
|
(test "literals"
|
|
|
|
|
"SELECT ARRAY[1, 2, 3]"
|
|
|
|
|
(ssql->sql #t '(select (array 1 2 3))))
|
|
|
|
|
|
|
|
|
|
(test "contains operator"
|
|
|
|
|
"SELECT (ARRAY['foo', 'bar'] @> ARRAY['bar'])"
|
|
|
|
|
(ssql->sql #t '(select (@> (array "foo" "bar") (array "bar")))))
|
|
|
|
|
|
|
|
|
|
(test "is contained operator"
|
|
|
|
|
"SELECT (ARRAY['bar'] <@ ARRAY['foo', 'bar'])"
|
|
|
|
|
(ssql->sql #t '(select (<@ (array "bar") (array "foo" "bar"))))))
|
|
|
|
|
|
|
|
|
|
(test-exit)
|