Package io.kestra.plugin.jdbc.postgresql
Class Query
- java.lang.Object
-
- io.kestra.core.models.tasks.Task
-
- io.kestra.plugin.jdbc.AbstractJdbcConnection
-
- io.kestra.plugin.jdbc.AbstractJdbcQuery
-
- io.kestra.plugin.jdbc.postgresql.Query
-
- All Implemented Interfaces:
io.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQuery.Output>,PostgresConnectionInterface
@Plugin(examples=@Example(full=true,title="Execute a query and fetch results on another task to update another table",code={"tasks:","- id: update"," type: io.kestra.plugin.jdbc.postgresql.Query"," url: jdbc:postgresql://127.0.0.1:56982/"," username: postgres"," password: pg_passwd"," sql: select concert_id, available, a, b, c, d, play_time, library_record, floatn_test, double_test, real_test, numeric_test, date_type, time_type, timez_type, timestamp_type, timestampz_type, interval_type, pay_by_quarter, schedule, json_type, blob_type from pgsql_types"," fetch: true","- id: use-fetched-data"," type: io.kestra.plugin.jdbc.postgresql.Query"," url: jdbc:postgresql://127.0.0.1:56982/"," username: postgres"," password: pg_passwd"," sql: \"{{#each outputs.update.rows}} INSERT INTO pl_store_distribute (year_month,store_code, update_date) values ({{this.play_time}}, {{this.concert_id}}, TO_TIMESTAMP(\'{{this.timestamp_type}}\', \'YYYY/MM/DDTHH24:MI:SS.US\') ); {{/each}}\""})) public class Query extends io.kestra.plugin.jdbc.AbstractJdbcQuery implements io.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQuery.Output>, PostgresConnectionInterface
-
-
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.plugin.jdbc.AbstractJdbcConnection
io.kestra.plugin.jdbc.AbstractJdbcConnection.AbstractJdbcConnectionBuilder<C extends io.kestra.plugin.jdbc.AbstractJdbcConnection,B extends io.kestra.plugin.jdbc.AbstractJdbcConnection.AbstractJdbcConnectionBuilder<C,B>>
-
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>>
-
Nested classes/interfaces inherited from interface io.kestra.plugin.jdbc.postgresql.PostgresConnectionInterface
PostgresConnectionInterface.SslMode
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Booleansslprotected java.lang.StringsslCertprotected java.lang.StringsslKeyprotected java.lang.StringsslKeyPasswordprotected PostgresConnectionInterface.SslModesslModeprotected java.lang.StringsslRootCert
-
Constructor Summary
Constructors Constructor Description Query()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.PropertiesconnectionProperties(io.kestra.core.runners.RunContext runContext)protected io.kestra.plugin.jdbc.AbstractCellConvertergetCellConverter(java.time.ZoneId zoneId)protected voidregisterDriver()io.kestra.plugin.jdbc.AbstractJdbcQuery.Outputrun(io.kestra.core.runners.RunContext runContext)-
Methods inherited from class io.kestra.plugin.jdbc.AbstractJdbcQuery
canEqual, equals, fetchResult, fetchResults, fetchToFile, getFetch, getFetchOne, getFetchSize, getSql, getStore, getTimeZoneId, hashCode, toString
-
Methods inherited from class io.kestra.plugin.jdbc.AbstractJdbcConnection
cleanup, connection, getAutoCommit, getPassword, getUrl, getUsername, tempFile, tempFile
-
Methods inherited from class io.kestra.core.models.tasks.Task
findById, findById, getDescription, getDisabled, getId, getRetry, getTimeout, getType, isFlowable
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.kestra.plugin.jdbc.postgresql.PostgresConnectionInterface
getSsl, getSslCert, getSslKey, getSslKeyPassword, getSslMode, getSslRootCert
-
-
-
-
Field Detail
-
ssl
protected java.lang.Boolean ssl
-
sslMode
protected PostgresConnectionInterface.SslMode sslMode
-
sslRootCert
protected java.lang.String sslRootCert
-
sslCert
protected java.lang.String sslCert
-
sslKey
protected java.lang.String sslKey
-
sslKeyPassword
protected java.lang.String sslKeyPassword
-
-
Method Detail
-
connectionProperties
protected java.util.Properties connectionProperties(io.kestra.core.runners.RunContext runContext) throws io.kestra.core.exceptions.IllegalVariableEvaluationException, java.io.IOException- Overrides:
connectionPropertiesin classio.kestra.plugin.jdbc.AbstractJdbcConnection- Throws:
io.kestra.core.exceptions.IllegalVariableEvaluationExceptionjava.io.IOException
-
getCellConverter
protected io.kestra.plugin.jdbc.AbstractCellConverter getCellConverter(java.time.ZoneId zoneId)
- Specified by:
getCellConverterin classio.kestra.plugin.jdbc.AbstractJdbcQuery
-
registerDriver
protected void registerDriver() throws java.sql.SQLException- Specified by:
registerDriverin classio.kestra.plugin.jdbc.AbstractJdbcConnection- Throws:
java.sql.SQLException
-
run
public io.kestra.plugin.jdbc.AbstractJdbcQuery.Output run(io.kestra.core.runners.RunContext runContext) throws java.lang.Exception- Specified by:
runin interfaceio.kestra.core.models.tasks.RunnableTask<io.kestra.plugin.jdbc.AbstractJdbcQuery.Output>- Overrides:
runin classio.kestra.plugin.jdbc.AbstractJdbcQuery- Throws:
java.lang.Exception
-
-