Package io.kestra.plugin.jdbc.mysql
Class Query
java.lang.Object
io.kestra.core.models.tasks.Task
io.kestra.plugin.jdbc.AbstractJdbcQuery
io.kestra.plugin.jdbc.mysql.Query
- All Implemented Interfaces:
io.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQuery.Output>,io.kestra.plugin.jdbc.AutoCommitInterface,io.kestra.plugin.jdbc.JdbcConnectionInterface,io.kestra.plugin.jdbc.JdbcQueryInterface,io.kestra.plugin.jdbc.JdbcStatementInterface
@Example(title="Send a SQL query to a MySQL Database and fetch a row as output.",code={"url: jdbc:mysql://127.0.0.1:3306/","username: mysql_user","password: mysql_passwd","sql: select * from mysql_types","fetchOne: true"}) @Example(title="Load a csv file into a MySQL table.",code={"url: jdbc:mysql://127.0.0.1:3306/","username: mysql_user","password: mysql_passwd","inputFile: \"{{ outputs.taskId.file }}\"","sql: |"," LOAD DATA LOCAL INFILE \'{{ inputFile }}\'"," INTO TABLE discounts FIELDS TERMINATED BY \',\'"," ENCLOSED BY \'\"\'"," LINES TERMINATED BY \'\\n\'"," IGNORE 1 ROWS;"})
public class Query
extends io.kestra.plugin.jdbc.AbstractJdbcQuery
implements io.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQuery.Output>, io.kestra.plugin.jdbc.AutoCommitInterface
-
Nested Class Summary
Nested classes/interfaces inherited from class io.kestra.plugin.jdbc.AbstractJdbcQuery
io.kestra.plugin.jdbc.AbstractJdbcQuery.AbstractJdbcQueryBuilder<C extends io.kestra.plugin.jdbc.AbstractJdbcQuery,B extends io.kestra.plugin.jdbc.AbstractJdbcQuery.AbstractJdbcQueryBuilder<C, B>>, io.kestra.plugin.jdbc.AbstractJdbcQuery.Output Nested classes/interfaces inherited from class io.kestra.core.models.tasks.Task
io.kestra.core.models.tasks.Task.TaskBuilder<C extends io.kestra.core.models.tasks.Task,B extends io.kestra.core.models.tasks.Task.TaskBuilder<C, B>> -
Field Summary
FieldsFields inherited from class io.kestra.plugin.jdbc.AbstractJdbcQuery
additionalVars, fetchSizeFields inherited from class io.kestra.core.models.tasks.Task
disabled, id, retry, timeout, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnectionProperties(io.kestra.core.runners.RunContext runContext) protected io.kestra.plugin.jdbc.AbstractCellConvertergetCellConverter(ZoneId zoneId) voidio.kestra.plugin.jdbc.AbstractJdbcQuery.Outputrun(io.kestra.core.runners.RunContext runContext) Methods inherited from class io.kestra.plugin.jdbc.AbstractJdbcQuery
canEqual, createStatement, equals, fetchResult, fetchResults, fetchToFile, getPassword, getSql, getTimeZoneId, getUrl, getUsername, hashCode, isFetch, isFetchOne, isStore, toStringMethods inherited from class io.kestra.core.models.tasks.Task
findById, findById, getDescription, getDisabled, getId, getLogLevel, getRetry, getTimeout, getType, getWorkerGroup, isAllowFailure, isFlowable, isSendToWorkerTaskMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.kestra.plugin.jdbc.AutoCommitInterface
getAutoCommitMethods inherited from interface io.kestra.plugin.jdbc.JdbcConnectionInterface
connectionMethods inherited from interface io.kestra.plugin.jdbc.JdbcStatementInterface
zoneId
-
Field Details
-
autoCommit
-
inputFile
-
workingDirectory
-
-
Constructor Details
-
Query
public Query()
-
-
Method Details
-
getCellConverter
- Specified by:
getCellConverterin classio.kestra.plugin.jdbc.AbstractJdbcQuery
-
registerDriver
- Specified by:
registerDriverin interfaceio.kestra.plugin.jdbc.JdbcConnectionInterface- Throws:
SQLException
-
connectionProperties
public Properties connectionProperties(io.kestra.core.runners.RunContext runContext) throws Exception - Specified by:
connectionPropertiesin interfaceio.kestra.plugin.jdbc.JdbcConnectionInterface- Throws:
Exception
-
getFetchSize
- Specified by:
getFetchSizein interfaceio.kestra.plugin.jdbc.JdbcQueryInterface- Overrides:
getFetchSizein classio.kestra.plugin.jdbc.AbstractJdbcQuery
-
run
public io.kestra.plugin.jdbc.AbstractJdbcQuery.Output run(io.kestra.core.runners.RunContext runContext) throws Exception - Specified by:
runin interfaceio.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQuery.Output>- Overrides:
runin classio.kestra.plugin.jdbc.AbstractJdbcQuery- Throws:
Exception
-