PostgreSQL - Download Query Results to Shipyard
Overviewβ
Turn the results of your SQL SELECT statement into a CSV file. Extract your PostgreSQL data into files for easier delivery to clients and partners.
Variablesβ
Name | Reference | Type | Required | Default | Options | Description |
---|---|---|---|---|---|---|
Host | POSTGRES_HOST | Alphanumeric | β | - | - | The domain or the IP address of the database you want to connect to. |
Port | POSTGRES_PORT | Integer | β | "5432" | - | Number for the database port to connect to. Defaults to 5432. |
Username | POSTGRES_USERNAME | Alphanumeric | β | - | - | Name of the user to connect to the database with. |
Password | POSTGRES_PASSWORD | Password | β | - | - | Password associated to the provided username. |
Database | POSTGRES_DATABASE | Alphanumeric | β | - | - | Name of the database in PostgreSQL to connect to. |
Extra URL Parameters | POSTGRES_URL_PARAMETERS | Alphanumeric | β | - | - | Extra parameters that will be placed at the end of the connection string, after the "?". Must be separated by "&". |
Query | POSTGRES_QUERY | Alphanumeric | β | - | - | A SELECT statement that returns data. Formatting is ignored. |
Shipyard Folder Name | POSTGRES_DESTINATION_FOLDER_NAME | Alphanumeric | β | - | - | The folder structure that you want your CSV to be created in. If left blank, the file will be created in the home directory. |
Shipyard File Name | POSTGRES_DESTINATION_FILE_NAME | Alphanumeric | β | output.csv | - | The file name that you want your generated CSV to have. |
Include Column Names as Header? | POSTGRES_FILE_HEADER | Boolean | β | True | - | If checked, your CSV file will include a header row with column names. |
YAMLβ
Below is the YAML template for this Blueprint and can be used in the Fleet YAML Editor.
source:
blueprint: PostgreSQL - Download Query Results to Shipyard
inputs:
POSTGRES_HOST: null ## REQUIRED
POSTGRES_PORT: '5432' ## REQUIRED
POSTGRES_USERNAME: null ## REQUIRED
POSTGRES_PASSWORD: null
POSTGRES_DATABASE: null ## REQUIRED
POSTGRES_URL_PARAMETERS: null
POSTGRES_QUERY: null ## REQUIRED
POSTGRES_DESTINATION_FOLDER_NAME: null
POSTGRES_DESTINATION_FILE_NAME: output.csv ## REQUIRED
POSTGRES_FILE_HEADER: true ## REQUIRED
type: BLUEPRINT
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- '200'
- '220'
- '221'
- '222'
- '249'