Hi!
I've just found that it's impossible to generate code out of raw sql which contain LISTEN or NOTIFY:
notify.sql:
-- Notify
NOTIFY foo, 'bar';
Error: unable to fetch table data: parse query folders: parse folder "./sql": parse file "notify.sql": parse queries: parse query 0: get args and cols: prepare: pq: syntax error at or near "NOTIFY"
For notify there is alternative which works:
SELECT pg_notify($1, $2);
However there is no alternative for LISTEN as there is no special function for it.
Sqlc has added support for LISTEN/NOTIFY some time ago
If you give me a clue where to start from, I can try implementing it myself.
Thanks!
Hi!
I've just found that it's impossible to generate code out of raw sql which contain
LISTENorNOTIFY:notify.sql:
Error:
unable to fetch table data: parse query folders: parse folder "./sql": parse file "notify.sql": parse queries: parse query 0: get args and cols: prepare: pq: syntax error at or near "NOTIFY"For notify there is alternative which works:
However there is no alternative for
LISTENas there is no special function for it.Sqlc has added support for
LISTEN/NOTIFYsome time agoIf you give me a clue where to start from, I can try implementing it myself.
Thanks!