New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function request: diag_query( :sql, :description ) #228
Labels
Comments
Looks nice, but the simple case always will. What about very long or complicated queries? How would one go about formatting them? |
Up to now I have only few columns per test case which are affected by the tests and displayed as before/after. I use it already with raise notice and one small function. But the test cases and the test results are not at the same place. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
i started to use tap and for my testing scenarios i need to pretty print queries before and after i run a function. But when i raise a notice it is not printed together with the test output, but before.
I thought maybe this could be a valuable feature for using pgTap.
I was thinking about something like:
create function schema.pretty_print_sql() returns setof text as $$
begin
return next diag_query('select a as "fieldA", b from tables where conditions', 'Explanation');
return next is(1, 1, 'test explanation);
end;
$$ language plpgsql;
and with
runtests('schema'::name);
should yield something like
ok 1 - schema.pretty_print_sql
1..1
Best Florian
The text was updated successfully, but these errors were encountered: