Class Queries

java.lang.Object
io.kestra.core.models.tasks.Task
io.kestra.plugin.jdbc.AbstractJdbcBaseQuery
io.kestra.plugin.jdbc.AbstractJdbcQueries
io.kestra.plugin.jdbc.mysql.Queries
All Implemented Interfaces:
io.kestra.core.models.Plugin, io.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQueries.MultiQueryOutput>, io.kestra.core.models.tasks.TaskInterface, io.kestra.core.models.WorkerJobLifecycle, io.kestra.plugin.jdbc.JdbcConnectionInterface, io.kestra.plugin.jdbc.JdbcQueriesInterface, io.kestra.plugin.jdbc.JdbcQueryInterface, io.kestra.plugin.jdbc.JdbcStatementInterface

@Plugin(examples=@Example(title="Send a SQL query to a MySQL Database and fetch a row as output.",full=true,code="id: send_multiple_queries\nnamespace: test.queries\ntasks:\n - id: test_queries_insert\n type: io.kestra.plugin.jdbc.mysql.Queries\n fetchType: FETCH\n url: jdbc:mysql://mysql:3306/kestra\n username: \"${{secret(\'MYSQL_USERNAME\')}}\"\n password: \"${{secret(\'MYSQL_PASSWORD\')}}\"\n sql: \"{{ read(\'populate.sql\') }}\"\n\n - id: test_queries_select\n type: io.kestra.plugin.jdbc.mysql.Queries\n fetchType: FETCH\n url: jdbc:mysql://mysql:3306/kestra\n username: root\n password: mysql_passwd\n sql: |\n SELECT firstName, lastName FROM employee;\n SELECT brand FROM laptop;\n")) public class Queries extends io.kestra.plugin.jdbc.AbstractJdbcQueries implements io.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQueries.MultiQueryOutput>
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.kestra.plugin.jdbc.AbstractJdbcQueries

    io.kestra.plugin.jdbc.AbstractJdbcQueries.AbstractJdbcQueriesBuilder<C extends io.kestra.plugin.jdbc.AbstractJdbcQueries,B extends io.kestra.plugin.jdbc.AbstractJdbcQueries.AbstractJdbcQueriesBuilder<C,B>>, io.kestra.plugin.jdbc.AbstractJdbcQueries.MultiQueryOutput

    Nested classes/interfaces inherited from class io.kestra.plugin.jdbc.AbstractJdbcBaseQuery

    io.kestra.plugin.jdbc.AbstractJdbcBaseQuery.AbstractJdbcBaseQueryBuilder<C extends io.kestra.plugin.jdbc.AbstractJdbcBaseQuery,B extends io.kestra.plugin.jdbc.AbstractJdbcBaseQuery.AbstractJdbcBaseQueryBuilder<C,B>>, io.kestra.plugin.jdbc.AbstractJdbcBaseQuery.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

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected Path
     

    Fields inherited from class io.kestra.plugin.jdbc.AbstractJdbcQueries

    transaction

    Fields inherited from class io.kestra.plugin.jdbc.AbstractJdbcBaseQuery

    additionalVars, fetchSize, fetchType, parameters, sql

    Fields inherited from class io.kestra.core.models.tasks.Task

    disabled, id, retry, timeout, type
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    connectionProperties(io.kestra.core.runners.RunContext runContext)
     
    protected io.kestra.plugin.jdbc.AbstractCellConverter
     
    io.kestra.core.models.property.Property<Integer>
     
    void
     
    io.kestra.plugin.jdbc.AbstractJdbcQueries.MultiQueryOutput
    run(io.kestra.core.runners.RunContext runContext)
     

    Methods inherited from class io.kestra.plugin.jdbc.AbstractJdbcQueries

    canEqual, equals, fetch, getTransaction, hashCode, toString

    Methods inherited from class io.kestra.plugin.jdbc.AbstractJdbcBaseQuery

    createPreparedStatement, createStatement, fetchResult, fetchResults, fetchToFile, getFetchType, getParameters, getPassword, getSql, getTimeZoneId, getUrl, getUsername, isFetch, isFetchOne, isStore, mapResultSetToMap, prepareStatement, renderFetchType, tags

    Methods inherited from class io.kestra.core.models.tasks.Task

    findById, findById, getDescription, getDisabled, getId, getLogLevel, getRetry, getRunIf, getTimeout, getType, getWorkerGroup, isAllowFailure, isAllowWarning, isFlowable, isLogToFile, isSendToWorkerTask

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.kestra.plugin.jdbc.JdbcConnectionInterface

    connection, connectionProperties

    Methods inherited from interface io.kestra.plugin.jdbc.JdbcStatementInterface

    zoneId

    Methods inherited from interface io.kestra.core.models.WorkerJobLifecycle

    kill, stop
  • Field Details

    • inputFile

      @PluginProperty(dynamic=true) protected String inputFile
    • workingDirectory

      protected transient Path workingDirectory
  • Constructor Details

    • Queries

      public Queries()
  • Method Details

    • getCellConverter

      protected io.kestra.plugin.jdbc.AbstractCellConverter getCellConverter(ZoneId zoneId)
      Specified by:
      getCellConverter in class io.kestra.plugin.jdbc.AbstractJdbcBaseQuery
    • registerDriver

      public void registerDriver() throws SQLException
      Specified by:
      registerDriver in interface io.kestra.plugin.jdbc.JdbcConnectionInterface
      Throws:
      SQLException
    • connectionProperties

      public Properties connectionProperties(io.kestra.core.runners.RunContext runContext) throws Exception
      Specified by:
      connectionProperties in interface io.kestra.plugin.jdbc.JdbcConnectionInterface
      Throws:
      Exception
    • getFetchSize

      public io.kestra.core.models.property.Property<Integer> getFetchSize()
      Specified by:
      getFetchSize in interface io.kestra.plugin.jdbc.JdbcQueryInterface
      Overrides:
      getFetchSize in class io.kestra.plugin.jdbc.AbstractJdbcBaseQuery
    • run

      public io.kestra.plugin.jdbc.AbstractJdbcQueries.MultiQueryOutput run(io.kestra.core.runners.RunContext runContext) throws Exception
      Specified by:
      run in interface io.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQueries.MultiQueryOutput>
      Overrides:
      run in class io.kestra.plugin.jdbc.AbstractJdbcQueries
      Throws:
      Exception