dbml
dbml copied to clipboard
Postgresql parsing fail on function body: no viable alternative at input
Hello,
Thanks for this PR https://github.com/holistics/dbml/pull/416
I've noticed the parser is not working on function like this:
CREATE FUNCTION public.myfunction() RETURNS void
LANGUAGE sql
AS $$
-- Do something
$$;
with the output being:
Error: no viable alternative at input '$$\n\t-- Do something\n $$;\n'
Regards.
As a workaround, I use this simple sed command to remove the functions from the sql dump sed '/CREATE FUNCTION/,/\$\$;/d' input.sql > output.sql
Hi mermetbt,
Thanks for the workaround. Indeed the new postgres grammar introduce in https://github.com/holistics/dbml/pull/416 even though more complete than our previous parser, it's still not perfect. We'll try to improve this in the future.