New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clickhouse: honor DefaultMigrationsTableEngine
when created WithInstance()
#617
clickhouse: honor DefaultMigrationsTableEngine
when created WithInstance()
#617
Conversation
Pull Request Test Coverage Report for Build 1220557373
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find and thanks for the PR! Only a few minor nits.
@@ -127,6 +127,10 @@ func (ch *ClickHouse) init() error { | |||
ch.config.MultiStatementMaxSize = DefaultMultiStatementMaxSize | |||
} | |||
|
|||
if len(ch.config.MigrationsTableEngine) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the odd white spacing a github issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think so, gofmt -s -w database/clickhouse/clickhouse.go
yield no diff.
@@ -106,6 +106,33 @@ func testSimple(t *testing.T, engine string) { | |||
}) | |||
} | |||
|
|||
func testSimpleWithInstance(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment that this is intended to test setting default config values with instances (or rename the test accordingly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to testSimpleWithInstanceDefaultConfigValues
.
…nce() Before this patch, clickhouse.WithInstance() would not select DefaultMigrationsTableEngine when no MigrationsTableEngine was provided through the clickhouse.Config{} argument. This behaviour forces the caller to always provide explicitely the config's MigrationsTableEngine. This patch make it so DefaultMigrationsTableEngine is used when MigrationsTableEngine is not provided through clickhouse.Config{}. Signed-off-by: Alexandre Perrin <alex@kaworu.ch>
Before this patch,
clickhouse.WithInstance()
would not selectDefaultMigrationsTableEngine
when noMigrationsTableEngine
was provided through theclickhouse.Config
argument. This behaviour forces the caller to always provide explicitely the config'sMigrationsTableEngine
.This patch make it so
DefaultMigrationsTableEngine
is used whenMigrationsTableEngine
is not provided throughclickhouse.Config
.