Skip to content

Support for PostgreSQL's listen/notify #479

@zhulik

Description

@zhulik

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions