I have a simple database query select * from listings where channel_code = {{select1.value}}
I'd like to export the results of this query as CSV format while renaming specific column headers. I want to do this so that the CSV I export matches the expected format/header column names of the downstream system that I will subsequently upload to
When I try to call utils.downloadFile I receive a warning that utils is undefined.
I am trying to write the transformer directly in the "Transform Results" section of the SQL query. What's the correct way to accomplish the above using this feature?
As an additional bonus for anyone who finds this post in future, Postgres doesn't have virtual columns like MySQL but it does allow you to generate hard-coded columns on the fly, like so:
select product_name, currency, price, 'ABCXYZ' as "Vendor", '' as "Discount"
from products
Then the resulting table will have a column called "Vendor" with every cell filled with value "ABCXYZ", and a column called "Discount" with every cell filled with a blank value.
I found this useful because I'm trying to use the SQL query to generate a CSV file and the system I am uploading the CSV file to expects certain columns to exist that don't exist in my DB.