Execute-sql output for multi-line select queries

Hello,

We are running the execute-sql command as part of a Github actions workflow on a sql file. The command looks something like this:

liquibase execute-sql --url <JDBC_URL> --username <USERNAME> --password <PASSWORD> --sqlfile=<FILE_PATH>

We have a bunch of SELECT queries in the file, some of them are one liners, while others are spread over multiple lines to improve readability. All these queries are terminated with the ; character.

We have noticed in the output (on the Github UI), that for the one-line SELECT queries for e.g.

select count(*) from schema.table;

We get to see the output correctly as such:

Output of select count(*) from schema.table:
COUNT |
0 |

However, in the same sql file, a query as the following:

select count(*)
from 
(
	select name, age
	from schema.table
	group by 1, 2
	having count(*) > 1
) d;

Yields the following output, instead of showing the count:

Successfully Executed: select count(*)
from 
(
	select name, age
	from schema.table
	group by 1, 2
	having count(*) > 1
) d

If I format the above query into one line, it does show the count output correctly. Is there a certain way to also show the results of query when the query is split multi-line?

Thanks!

1 Like