The error message of your second attempt gives a hint:
AssertionError Assert failed: Query argument mismatch. Expected keys: (:uids]) Actual keys: (:uids) Missing keys: (:uids])
Everything seems to go south when yesql tries to parse the :uids key, as it adds the closing bracket of the array definition. Let's try something else:
-- name: insert-into-sometable<! -- inserts in the sometable the lid and uids INSERT INTO sometable (lid, uids) values(:lid, ARRAY[ :uids ])
Note the extra spaces between :uids and array brackets.
=> (insert-into-sometable<! {:lid 1, :uids [1 2 42]) ;; => 1
Looks like an error in yesql for me,: :uid] should never be parsed as a valid key.
Edit: I was going to write an error with yesql, but it has already been fixed with the recently released version 0.5.2.
source share