summaryrefslogtreecommitdiff
path: root/lib/output/pq/sql/selectColumns.sql
blob: e9cd107318458948457a7c592c71ebc95c742b0b (plain)
1
2
3
4
5
6
SELECT t.table_name, STRING_AGG(c.column_name, '|' ORDER BY c.ordinal_position)
FROM mygrate.source s
	JOIN information_schema.tables t USING(table_schema)
	LEFT OUTER JOIN information_schema.columns c USING(table_schema, table_name)
WHERE s.id = $1
GROUP BY t.table_name