yaml
type: "io.kestra.plugin.jdbc.postgresql.queries"
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
Default 10000
Default NONE
Possible Values
STOREFETCHFETCH_ONENONE
Default false
Possible Values
DISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULL
Default true
SubType object
Format uri