Skip to content

Conversation

JiriCtvrtka
Copy link
Contributor

@JiriCtvrtka JiriCtvrtka commented Sep 17, 2025

@percona percona deleted a comment from percona-robot Sep 22, 2025
)

func main() {
data := map[string]map[string]any{
Copy link
Contributor Author

@JiriCtvrtka JiriCtvrtka Sep 23, 2025

Choose a reason for hiding this comment

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

Main is used for generate sql files for our tests.


const (
databaseEngineSimple = "MergeTree"
databaseEngineCluster = "ReplicatedMergeTree('/clickhouse/tables/{shard}/metrics', '{replica}')"
Copy link
Contributor Author

@JiriCtvrtka JiriCtvrtka Sep 23, 2025

Choose a reason for hiding this comment

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

No need to replace placeholders ({shard} and {replica}). It is working anyway.

"github.com/sirupsen/logrus"
)

type memMigration struct {
Copy link
Contributor Author

@JiriCtvrtka JiriCtvrtka Sep 23, 2025

Choose a reason for hiding this comment

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

It is enough to keep rendered migrations in memory. No need to save them into file.

docker run -d --platform=linux/amd64 --name pmm-clickhouse-test -p19000:9000 -p18123:8123 clickhouse/clickhouse-server:23.8.2.7
make test-env

test-env-up-apple: ## Start docker containers used for testing on Apple chips
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed anymore. Original image is now compatible with Apple silicon.

@JiriCtvrtka
Copy link
Contributor Author

The PR introduces dynamic (template-generated) SQL migrations, allowing the ENGINE type to be changed based on the setup. I wanted to avoid adding more static files for cluster setups, as this approach is more future-proof.

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.

1 participant