Sql Source
This plugin must be used in conjunction with at least a database driver. We are using build tag to determine which driver will be included. This repository lists all the supported drivers.
This plugin supports drivers by default. User can compile plugin that only support one driver by himself,
for example, if he only wants sqlserver, then he can build with build tag sqlserver
.
Sqlserver build command
The configuration for this source is $ekuiper/etc/sources/sql.yaml
. The format is as below:
User can specify the global sql source settings here. The configuration items specified in default
section will be taken as default settings for the source when running this source.
interval
The target database url
internalSqlQueryCfg
table
: table name to querylimit
: how many items need fetch from the result- : which column for the table act as index to record the offset
indexFieldType
: column type for the indexField, if it is dateTime type, must set this field withDATETIME
dateTimeFormat
: data time format for the index field
TemplateSql
: sql statement template- : which column for the table act as index to record the offset
indexValue
: initial index value, if user specify this field, the query will use this initial value as query condition, will update next query when get a greater value.indexFieldType
: column type for the indexField, if it is dateTime type, must set this field withDATETIME
dateTimeFormat
: data time format for the index field
Note: users only need set internalSqlQueryCfg or templateSqlQueryCfg, if both set, templateSqlQueryCfg will be used
If you have a specific connection that need to overwrite the default settings, you can create a customized section. In the previous sample, we create a specific setting named with template_config
. Then you can specify the configuration with option when creating the stream definition (see for more info).