PugSQL currently skips any .sql file containing DDL or procedural SQL such as
CREATE FUNCTION ... LANGUAGE plpgsql. This means files that define stored
functions are ignored, even if they also include valid query definitions tagged
with -- :name.
Problem
Teams using PostgreSQL functions for business logic cannot expose them through
PugSQL without creating separate thin wrapper files containing a synthetic
SELECT * FROM function(:args) query.
Requested Feature:
Allow PugSQL to recognize and register queries or function calls appearing
after a CREATE FUNCTION block inside the same file.
Optionally provide a config flag such as allow_ddl_statements = true
so database functions can coexist with callable queries.
Benefit:
Makes PugSQL viable for function-centric PostgreSQL apps and aligns with
the HugSQL/YesQL philosophy where stored procedures are first‑class citizens.
PugSQL currently skips any .sql file containing DDL or procedural SQL such as
CREATE FUNCTION ... LANGUAGE plpgsql. This means files that define stored
functions are ignored, even if they also include valid query definitions tagged
with -- :name.
Problem
Teams using PostgreSQL functions for business logic cannot expose them through
PugSQL without creating separate thin wrapper files containing a synthetic
SELECT * FROM function(:args) query.
Requested Feature:
Benefit:
Makes PugSQL viable for function-centric PostgreSQL apps and aligns with
the HugSQL/YesQL philosophy where stored procedures are first‑class citizens.