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

Change database before query #256

Closed
abh opened this issue Dec 8, 2022 · 3 comments
Closed

Change database before query #256

abh opened this issue Dec 8, 2022 · 3 comments

Comments

@abh
Copy link
Contributor

abh commented Dec 8, 2022

I'm using a dictionary in a query (with the query builder) as dictGet("some_dictionary", "field", id). This looks for the dictionary in the default database.

I tried using "$database.some_dictionary", but that macro doesn't exist.

It'd be helpful if the clickhouse datasource used the specified database before running the query, so an unqualified table or dictionary name use the database specified in the panel.

@cletter7
Copy link
Contributor

cletter7 commented Dec 9, 2022

Hi @abh. Could you share which fields do you fill in, and how the result query looks like?

@bossinc
Copy link
Collaborator

bossinc commented Mar 17, 2023

Hello, @abh the query builder doesn't play nice with CH macros, but there has been an update to the query builder that might work with macros. If you give it a try with the query builder again and it doesn't work, I would suggest using the query text view 🙂

@bossinc
Copy link
Collaborator

bossinc commented Mar 21, 2023

I am closing this issue. Feel free to reopen if the problem has not been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants