[FORMATTING]Postgresql Function body is not getting formatted
CREATE OR REPLACE FUNCTION my_fn() RETURNS json AS
$BODY$
SELECT test, blah, yah, another, tehe from t_table
$BODY$
LANGUAGE sql VOLATILE
COST 100;
used via prettier-plugin-sql -> sql-formatter version: 10.7.2 Tried the above example at https://sql-formatter-org.github.io/sql-formatter/ as well
This is by design because the body might be written in all sort of languages besides SQL. The formatter treats the body as a string and does not touch the contents.
This behavior is unlikely to change with the current architecture of the formatter. I'm working on a new SQL formatting library, which in theory should be able to tackle this problem, but this is still in very early stages of development.
Closing this as the current behaviour is sort-of by design. Plus it's not feasible to fix in the current architecture.