hugsql

igrishaev 2025-05-23T14:12:00.648239Z

Suddenly, I'm facing an issue when declaring a Postgres function with assignment inside:

-- :name create-func :!
create or replace function pg_temp.foo(period interval) returns text
as $$
declare years int;
begin
   years := 42 -- !!! this
   ...
Hugsql thinks it's a named parameter and argues: > Parameter Mismatch: := parameter data not found. Is there any kind of "raw" or "verbatim" syntax or options to bypass it? I can jam it inside as a Clojure expression with a string " := " but this is too ugly, I'm afraid. UPD: I'm afraid that Yesql suffers from the same issue too but haven't tried it yet

igrishaev 2025-05-23T14:38:57.170699Z

Solved by quoting a single colon with \ :

😄 1