Getting statements in function body

74 views
Skip to first unread message

義務優愛

unread,
Jun 21, 2016, 11:16:46 PM6/21/16
to sqlparse
Say I have this function definition (for Postgres):
CREATE OR REPLACE FUNCTION func() RETURNS setof int AS
$$
SELECT
1 FROM Foo;
SELECT
2 FROM Bar;
$$ language sql
;

Does sqlparse offer me some way of either directly getting at the two statements inside the function body or, if that isn't possible, to get the contents of the dollar-quoted string so I can send it back to sqlparse.parse and get the two statements?
Reply all
Reply to author
Forward
0 new messages