fix(outputs.sql): Move 'conversion_style' option to the right place (#13875)

This commit is contained in:
Sven Rebhan 2023-09-07 15:20:57 +02:00 committed by GitHub
parent 9e960f40ba
commit a528e842ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 34 deletions

View File

@ -106,13 +106,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## Initialization SQL ## Initialization SQL
# init_sql = "" # init_sql = ""
## This setting controls the behavior of the unsigned value. By default the
## setting will take the integer value and append the unsigned value to it. The other
## option is "literal", which will use the actual value the user provides to
## the unsigned option. This is useful for a database like ClickHouse where
## the unsigned value should use a value like "uint64".
# conversion_style = "unsigned_suffix"
## Maximum amount of time a connection may be idle. "0s" means connections are ## Maximum amount of time a connection may be idle. "0s" means connections are
## never closed due to idle time. ## never closed due to idle time.
# connection_max_idle_time = "0s" # connection_max_idle_time = "0s"
@ -147,6 +140,12 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
# defaultvalue = "TEXT" # defaultvalue = "TEXT"
# unsigned = "UNSIGNED" # unsigned = "UNSIGNED"
# bool = "BOOL" # bool = "BOOL"
# ## This setting controls the behavior of the unsigned value. By default the
# ## setting will take the integer value and append the unsigned value to it. The other
# ## option is "literal", which will use the actual value the user provides to
# ## the unsigned option. This is useful for a database like ClickHouse where
# ## the unsigned value should use a value like "uint64".
# # conversion_style = "unsigned_suffix"
``` ```
## Driver-specific information ## Driver-specific information

View File

@ -28,13 +28,6 @@
## Initialization SQL ## Initialization SQL
# init_sql = "" # init_sql = ""
## This setting controls the behavior of the unsigned value. By default the
## setting will take the integer value and append the unsigned value to it. The other
## option is "literal", which will use the actual value the user provides to
## the unsigned option. This is useful for a database like ClickHouse where
## the unsigned value should use a value like "uint64".
# conversion_style = "unsigned_suffix"
## Maximum amount of time a connection may be idle. "0s" means connections are ## Maximum amount of time a connection may be idle. "0s" means connections are
## never closed due to idle time. ## never closed due to idle time.
# connection_max_idle_time = "0s" # connection_max_idle_time = "0s"
@ -69,3 +62,9 @@
# defaultvalue = "TEXT" # defaultvalue = "TEXT"
# unsigned = "UNSIGNED" # unsigned = "UNSIGNED"
# bool = "BOOL" # bool = "BOOL"
# ## This setting controls the behavior of the unsigned value. By default the
# ## setting will take the integer value and append the unsigned value to it. The other
# ## option is "literal", which will use the actual value the user provides to
# ## the unsigned option. This is useful for a database like ClickHouse where
# ## the unsigned value should use a value like "uint64".
# # conversion_style = "unsigned_suffix"

View File

@ -24,31 +24,31 @@ import (
var sampleConfig string var sampleConfig string
type ConvertStruct struct { type ConvertStruct struct {
Integer string Integer string `toml:"integer"`
Real string Real string `toml:"real"`
Text string Text string `toml:"text"`
Timestamp string Timestamp string `toml:"timestamp"`
Defaultvalue string Defaultvalue string `toml:"defaultvalue"`
Unsigned string Unsigned string `toml:"unsigned"`
Bool string Bool string `toml:"bool"`
ConversionStyle string ConversionStyle string `toml:"conversion_style"`
} }
type SQL struct { type SQL struct {
Driver string Driver string `toml:"driver"`
DataSourceName string DataSourceName string `toml:"data_source_name"`
TimestampColumn string TimestampColumn string `toml:"timestamp_column"`
TableTemplate string TableTemplate string `toml:"table_template"`
TableExistsTemplate string TableExistsTemplate string `toml:"table_exists_template"`
InitSQL string `toml:"init_sql"` InitSQL string `toml:"init_sql"`
Convert ConvertStruct Convert ConvertStruct `toml:"convert"`
ConnectionMaxIdleTime config.Duration ConnectionMaxIdleTime config.Duration `toml:"connection_max_idle_time"`
ConnectionMaxLifetime config.Duration ConnectionMaxLifetime config.Duration `toml:"connection_max_lifetime"`
ConnectionMaxIdle int ConnectionMaxIdle int `toml:"connection_max_idle"`
ConnectionMaxOpen int ConnectionMaxOpen int `toml:"connection_max_open"`
Log telegraf.Logger `toml:"-"`
db *gosql.DB db *gosql.DB
Log telegraf.Logger `toml:"-"`
tables map[string]bool tables map[string]bool
} }