Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go/datasource/proxy/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ type MySQLConfig struct {

type PostgresConfig struct {
// MaxConns is the maximum size of the pool
MaxConns int32 `json:"maxConns,omitempty" yaml:"maxConns,omitempty"`
MaxConns int32 `json:"max_conns,omitempty" yaml:"max_conns,omitempty"`
// ConnectTimeout the timeout value used for socket connect operations.
ConnectTimeout common.DurationString `json:"connectTimeout,omitempty" yaml:"connectTimeout,omitempty"`
ConnectTimeout common.DurationString `json:"connect_timeout,omitempty" yaml:"connect_timeout,omitempty"`
// PrepareThreshold specifies the number of PreparedStatement executions that must occur before the driver begins using server-side prepared statements.
PrepareThreshold *int `json:"prepareThreshold,omitempty" yaml:"prepareThreshold,omitempty"`
PrepareThreshold *int `json:"prepare_threshold,omitempty" yaml:"prepare_threshold,omitempty"`
Comment thread
ZPascal marked this conversation as resolved.
// SSLMode to use when connecting to postgres
SSLMode SSLMode `json:"sslMode,omitempty" yaml:"sslMode,omitempty"`
SSLMode SSLMode `json:"ssl_mode,omitempty" yaml:"ssl_mode,omitempty"`
// Options specifies command-line options to send to the server at connection start
Options string `json:"options,omitempty" yaml:"options,omitempty"`
Comment thread
ZPascal marked this conversation as resolved.
}
Expand Down
18 changes: 9 additions & 9 deletions go/datasource/proxy/sql/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestUnmarshalJSONConfig(t *testing.T) {
"host": "localhost:5432",
"database": "test",
"postgres": {
"sslMode": "disable"
"ssl_mode": "disable"
}
}
`,
Expand Down Expand Up @@ -161,10 +161,10 @@ func TestUnmarshalJSONConfig(t *testing.T) {
"host": "localhost:5432",
"database": "test",
"postgres": {
"maxConns": 50,
"connectTimeout": "5m",
"prepareThreshold": 5,
"sslMode": "require",
"max_conns": 50,
"connect_timeout": "5m",
"prepare_threshold": 5,
"ssl_mode": "require",
"options": "-c search_path=myschema"
Comment thread
ZPascal marked this conversation as resolved.
}
}
Expand All @@ -190,7 +190,7 @@ func TestUnmarshalJSONConfig(t *testing.T) {
"host": "localhost:5432",
"database": "test",
"postgres": {
"sslMode": "notreal"
"ssl_mode": "notreal"
}
}
`,
Expand Down Expand Up @@ -266,7 +266,7 @@ driver: postgres
host: localhost:5432
database: test
postgres:
sslMode: disable
ssl_mode: disable
`,
result: Config{
Driver: DriverPostgreSQL,
Expand Down Expand Up @@ -376,7 +376,7 @@ driver: postgres
host: localhost:5432
database: test
postgres:
sslMode: verify-full
ssl_mode: verify-full
`,
result: Config{
Driver: DriverPostgreSQL,
Expand All @@ -394,7 +394,7 @@ driver: postgres
host: localhost:5432
database: test
postgres:
sslMode: invalid
ssl_mode: invalid
`,
expectErr: true,
},
Expand Down
Loading