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

Execution of sql scripts #26

Open
aleksvagachev opened this issue Feb 10, 2024 · 3 comments
Open

Execution of sql scripts #26

aleksvagachev opened this issue Feb 10, 2024 · 3 comments

Comments

@aleksvagachev
Copy link
Collaborator

SUMMARY

It may not be convenient to use the clickhouse_client module to create tables or more complex queries. Maybe it's worth implementing a module for reading and executing scripts, or adding script execution functionality to clickhouse_client?

ISSUE TYPE
  • Feature Idea
@Andersson007
Copy link
Contributor

@aleksvagachev i don't know how it works in clickhouse but if they support something like dump / restore in other RDBMS maybe we should create a module for that (i don't like this to be like in c.postgres/mysql where it's done via _db modules). E.g. possible interface

- name: Dump data
  community.clickhouse.clickhouse_data:
    state: dump
    file: /path/to/file

- name: Restore data
  community.clikhouse.clickhouse_data:
    state: restore
    file: /path/to/file

the module name, the args names, and choices can be discussed but the idea should be clear. I would like to mix it with clickhouse_db module and this would solve your issue. But i'm not an expert.
What do you think?

@aleksvagachev
Copy link
Collaborator Author

@Andersson007 I have not encountered dump/restore in clickhouse. I'm not sure that there is such a thing. There is clickhouse-backup and other additional utilities. Maybe try to consider their implementation or come up with something of your own from scratch? In this issue, I wanted to have functionality similar to the postgresql_script module.

@Andersson007
Copy link
Contributor

Andersson007 commented Feb 12, 2024

@aleksvagachev sure, feel free to add the module. I would avoid adding any return values though as it's often gonna execute more than 1 query. It was a great source of pain in c.postgres. We could add it later if needed. Feel free to create an issue and work on it or put help wanted if you wouldn't like to do it yourself. UPDATE: we could use this issue:)

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

No branches or pull requests

2 participants