Queries
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
sql *Requiredstring
url *Requiredstring
afterSQL string
fetchSize integerstring
Default
10000fetchType string
Default
NONEPossible Values
STOREFETCHFETCH_ONENONEparameters object
password string
ssl booleanstring
Default
falsesslCert string
sslKey string
sslKeyPassword string
sslMode string
Possible Values
DISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULLsslRootCert string
timeZoneId string
transaction booleanstring
Default
trueusername string
Outputs
outputs array
Definitions
io.kestra.plugin.jdbc.AbstractJdbcBaseQuery-Output
rowobject
rowsarray
SubTypeobject
sizeinteger
uristring
Format
uriMetrics
fetch.size counter
Unit
rows