Query
yaml
type: "io.kestra.plugin.jdbc.postgresql.query"
Examples
yaml
id: postgres_query
namespace: company.team
tasks:
- id: fetch
type: io.kestra.plugin.jdbc.postgresql.Query
url: jdbc:postgresql://127.0.0.1:56982/
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
sql: select concert_id, available, a, b, c, d, play_time, library_record, floatn_test, double_test, real_test, numeric_test, date_type, time_type, timez_type, timestamp_type, timestampz_type, interval_type, pay_by_quarter, schedule, json_type, blob_type from pgsql_types
fetchType: FETCH
- id: use_fetched_data
type: io.kestra.plugin.jdbc.postgresql.Query
url: jdbc:postgresql://127.0.0.1:56982/
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
sql: "{% for row in outputs.fetch.rows %} INSERT INTO pl_store_distribute (year_month,store_code, update_date) values ({{row.play_time}}, {{row.concert_id}}, TO_TIMESTAMP('{{row.timestamp_type}}', 'YYYY-MM-DDTHH:MI:SS.US') ); {% endfor %}"
Properties
url *Requiredstring
fetchSize integerstring
Default
10000
fetchType string
Default
NONE
Possible Values
STORE
FETCH
FETCH_ONE
NONE
parameters object
password string
sql string
ssl booleanstring
Default
false
sslCert string
sslKey string
sslKeyPassword string
sslMode string
Possible Values
DISABLE
ALLOW
PREFER
REQUIRE
VERIFY_CA
VERIFY_FULL
sslRootCert string
timeZoneId string
username string
Outputs
row object
rows array
SubType object
size integer
uri string
Format
uri