Batch
Bulk insert rows into MySQL using prepared statements
Batch
Bulk insert rows into MySQL using prepared statements
yaml
type: io.kestra.plugin.jdbc.mysql.BatchExamples
yaml
id: mysql_batch
namespace: company.team
tasks:
- id: query
type: io.kestra.plugin.jdbc.mysql.Query
url: jdbc:mysql://127.0.0.1:3306/
username: mysql_user
password: mysql_password
sql: |
SELECT *
FROM xref
LIMIT 1500;
fetchType: STORE
- id: update
type: io.kestra.plugin.jdbc.mysql.Batch
from: "{{ outputs.query.uri }}"
url: jdbc:mysql://127.0.0.1:3306/
username: mysql_user
password: mysql_password
sql: |
insert into xref values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
yaml
id: mysql_batch
namespace: company.team
tasks:
- id: query
type: io.kestra.plugin.jdbc.mysql.Query
url: jdbc:mysql://127.0.0.1:3306/
username: mysql_user
password: mysql_password
sql: |
SELECT *
FROM xref
LIMIT 1500;
fetchType: STORE
- id: update
type: io.kestra.plugin.jdbc.mysql.Batch
from: "{{ outputs.query.uri }}"
url: jdbc:mysql://127.0.0.1:3306/
username: mysql_user
password: mysql_password
table: xref
Properties
from *Requiredstring
url *Requiredstring
chunk integerstring
Default
1000columns array
SubTypestring
password string
sql string
table string
timeZoneId string
username string
Outputs
rowCount integer
updatedCount integer
Metrics
query counter
Unit
queriesrecords counter
Unit
recordsupdated counter
Unit
records