-
Notifications
You must be signed in to change notification settings - Fork 21
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
Provide re-usable building blocks for queries #328
Comments
That's sort of what the query snippets are for... aren't they being used at Mozilla? So query snippets will save you the trouble of finding and typing this all over again, but it won't update after you insert the snippet into the query. |
@rafrombrc They look like they would, yes. However, I can't seem to find a way to access them through the sql.telemetry.mozilla.org interface. |
@mcomella Sorry for the delay in replying... I got lost in some confusion re: the availability of query snippets, because I found a page (here: https://help.redash.io/article/39-query-snippets-shortcuts) that says only admins can create them. Our experimentation shows that this is incorrect, however, non-admins can create them. If you click on your name in the upper right hand corner, click on your name in the dropdown menu, you should see a 'query snippets' tag that will take you to the interface. The help.redash.io page linked above should help you get started (incorrect availability information notwithstanding). |
@rafrombrc Can query snippets be shared between users without copy/pasting then? As someone who infrequently uses re-dash, I think it'd be great to steal some snippets (like DAUs) from high frequency users on my team. |
@mcomella Not sure. I just created a snippet called 'hll_convert' which contains the boilerplate for rendering a hyperloglog field as a numeric count value. Try typing 'hll_' when you're entering a query and see if it shows up as an auto-complete option for you. @arikfr Also, I should draw your attention to the https://help.redash.io/article/39-query-snippets-shortcuts page which has inaccurate information about only admins being able to create query snippets. Is there a place to submit a bug for getting that page corrected? |
@mcomella Snippets work via the autocomplete mechanism that is in effect when you're creating and/or editing a query. Every snippet has a "trigger", if you type that trigger in while you're in the query editor you should see the snippet show up as an autocomplete suggestion. Select it from the autocomplete dropdown, and the snippet will be inserted where the cursor is. So if you type 'hll_' while you're in the query editor you should see the snippet show up and become usable. Hope this helps! |
So it does! Great! :) Should we close this issue as WORKSFORME or perhaps there is an action item to publicize this? |
@rafrombrc I missed your original message, but happy to share that all the help pages sources are now on GitHub (here's the query snippets page). I already updated this page and removed the note about admins. Thanks! |
As someone who doesn't use sql.tmo often, every time I write a query, I need to find a previously written query to do the same tasks over and over again. Examples:
It'd be really great if there were reusable building blocks so every query didn't have to reproduce this functionality - think of it like functions for mozilla's redash!
The text was updated successfully, but these errors were encountered: