CopyIn
CopyIn
yaml
type: "io.kestra.plugin.jdbc.postgresql.CopyIn"Examples
yaml
id: postgres_copy_in
namespace: company.team
tasks:
- id: copy_in
type: io.kestra.plugin.jdbc.postgresql.CopyIn
url: jdbc:postgresql://127.0.0.1:5432/
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
format: CSV
from: "{{ outputs.export.uri }}"
table: my_destination_table
header: true
delimiter: "\t"
yaml
id: postgres_copyin
namespace: company.team
tasks:
- id: download_products
type: io.kestra.plugin.core.http.Download
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/products.csv
- id: create_products_table
type: io.kestra.plugin.jdbc.postgresql.Query
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 varchar(5),
product_name varchar(100),
product_category varchar(50),
brand varchar(50)
);
- id: copyin_products
type: io.kestra.plugin.jdbc.postgresql.CopyIn
url: "jdbc:postgresql://{{ secret('POSTGRES_HOST') }}:5432/postgres"
username: "{{ secret('POSTGRES_USERNAME') }}"
password: "{{ secret('POSTGRES_PASSWORD') }}"
format: CSV
from: "{{ outputs.download_products.uri }}"
table: products
header: true
delimiter: ","
Properties
from *Requiredstring
url *Requiredstring
columns array
SubTypestring
delimiter string
encoding string
escape string
forceNotNull array
SubTypestring
forceNull array
SubTypestring
forceQuote array
SubTypestring
format string
Default
TEXTPossible Values
TEXTCSVBINARYfreeze booleanstring
header booleanstring
nullString string
oids booleanstring
password string
quote string
ssl booleanstring
Default
falsesslCert string
sslKey string
sslKeyPassword string
sslMode string
Possible Values
DISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULLsslRootCert string
table string
username string
Outputs
rowCount integer
Metrics
rows counter
Unit
rows