Skip to content
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: Support migrations on cluster #432

Merged

Conversation

FatherCandle
Copy link
Contributor

Adding functionally to support usage of Dbmate with ClickHouse cluster.

Easy default usage with just supplying "on_cluster" query parameter.

Took the approach of trying to keep the changes simple without breaking any existing stuff.
95% of the changes in the PR are for the tests and setups of the ClickHouse cluster dockers.

Will happily answer any questions, and would really appreciate reviews.

Solves existing requests in discussions:
#356
#244

Copy link

@Mizaro Mizaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice implementation! LGTM :)

}

// Makes sure driver creatinon is atomic
func TestDriverCreationSanity(t *testing.T) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice additional test. Maybe we should suggest enforcing it for all drivers.

@amacneil
Copy link
Owner

@FatherCandle I gave you commit access, so feel free to merge if there is sufficient consensus on code review + test cases.

@dossy @gregwebs

@FatherCandle
Copy link
Contributor Author

@FatherCandle I gave you commit access, so feel free to merge if there is sufficient consensus on code review + test cases.

@dossy @gregwebs

That's awesome :)
I would appreciate the CR, it seems scary because I had to add manually Clickhouse config files for the tests.
But the actual changes aren't that big.

Copy link
Collaborator

@dossy dossy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great!

Would you mind also updating the ClickHouse section of the README with documentation listing the 4 new connection query params this PR introduces (on_cluster, zoo_path, cluster_macro, and replica_macro), too, please?

pkg/driver/clickhouse/clickhouse.go Outdated Show resolved Hide resolved
pkg/driver/clickhouse/clickhouse.go Outdated Show resolved Hide resolved
@FatherCandle
Copy link
Contributor Author

This all looks great!

Would you mind also updating the ClickHouse section of the README with documentation listing the 4 new connection query params this PR introduces (on_cluster, zoo_path, cluster_macro, and replica_macro), too, please?

@dossy
Added the docs in the README section of ClickHouse + the escape string suggetsion.
You are welcome to review it again :)

Copy link
Collaborator

@dossy dossy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look great, thanks! I think the documentation will be particularly useful for anyone who wants to take advantage of this new functionality.

@FatherCandle FatherCandle merged commit a336dbb into amacneil:main May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants