Queries
yaml
type: "io.kestra.plugin.jdbc.postgresql.queries"
Examples
yaml
id: postgres_query
namespace: company.team
tasks:
- id: fetch
type: io.kestra.plugin.jdbc.postgresql.Queries
url: jdbc:postgresql://127.0.0.1:56982/
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
sql: |
SELECT firstName, lastName FROM employee;
SELECT brand FROM laptop;
fetchType: FETCH
yaml
id: postgres_queries
namespace: company.team
tasks:
- id: init_products
type: io.kestra.plugin.jdbc.postgresql.Queries
url: "jdbc:postgresql://{{secret('POSTGRES_HOST')}}:5432/postgres"
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
sql: |
CREATE TABLE IF NOT EXISTS products(
product_id SERIAL PRIMARY KEY,
product_name varchar(100),
product_category varchar(50),
brand varchar(50)
);
INSERT INTO products VALUES(1, 'streamline turn-key systems','Electronics','gomez') ON CONFLICT (product_id) DO NOTHING;
INSERT INTO products VALUES(2, 'morph viral applications','Household','wolfe') ON CONFLICT (product_id) DO NOTHING;
INSERT INTO products VALUES(3, 'expedite front-end schemas','Household','davis-martinez') ON CONFLICT (product_id) DO NOTHING;
INSERT INTO products VALUES(4, 'syndicate robust ROI','Outdoor','ruiz-price') ON CONFLICT (product_id) DO NOTHING;
fetchType: NONE
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
transaction booleanstring
Default
true
username string
Definitions
io.kestra.plugin.jdbc.AbstractJdbcBaseQuery-Output
row object
rows array
SubType object
size integer
uri string
Format
uri