explorerhq / sql-explorer

SQL reporting that Just Works. Fast, simple, and confusion-free. Write and share queries in a delightful SQL editor, with AI assistance.

Home Page:https://www.sqlexplorer.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Save Parameter key and values

dwmorrison33 opened this issue · comments

I am curious if there is a way to save a query parameters value for later use instead of having to re-enter it each time one goes to the Query Detail page? I only ask because I have not been able to find an answer to that with Google and I do not see anything in the codebase to do it, but maybe I am missing something. Thank you

@dwmorrison33 could you provide an example of what you mean please?

@marksweb Thank you for your response, below is an example. I create a new query with id as the parameter and execute it:
Screen Shot 2022-08-27 at 3 46 31 PM

After navigating back to the Query List page and clicking again on this query, the parameter id no longer has the value 10000 populated:
Screen Shot 2022-08-27 at 3 46 47 PM

Is there a way to persist this value? Also, on a side note, I am using version 1.1.3 of your package since my company is on Django 1.11 and that is the last version that is compatible.

@dwmorrison33 Right, I'm with you - and I thought that was what you meant. I'm fairly sure the app can't do that, at least as it is now.

My suggestion would be to create bookmarks with the query params defined in them.

@dwmorrison33 Right, I'm with you - and I thought that was what you meant. I'm fairly sure the app can't do that, at least as it is now.

My suggestion would be to create bookmarks with the query params defined in them.

Would you mind if I implemented a feature to save the query Params so that we can save a default value and then put in a pull request, as saving bookmarks will become a bit laborious across the organizations users who are using these queries each day. I just want to check before I work on this feature and you all not wanting it, but I think it would be useful to others as well.

@dwmorrison33 Yeah that sounds like it'd be really useful.

Create a branch from the 1.1.3 tag and when you come to a PR, target this new branch I've setup; https://github.com/groveco/django-sql-explorer/tree/release/1.1.4

Then I can do a 1.1.4 release and then, hopefully, merge it to the main branch for it to benefit the users of the latest version as well 👍

@marksweb I had a chance to work on the changes yesterday and finished them up this morning, but do not have permission to push up the code to the repo. Is there another way to push the code so that I can create a PR and request to merge into https://github.com/groveco/django-sql-explorer/tree/release/1.1.4?

@dwmorrison33 ok, so not having permission is correct.

The workflow for contributing is among the lines of...

  • fork the repo
  • clone your fork to your local machine
  • add the main repo as a remote (this allows you to pull changes in to your fork and base branches from upstream branches like we want here)
  • create a branch for your contribution and remember to check for guidelines on the repo
  • once complete and all changes are pushed to your fork github will allow you to create a pull request from the branch.
  • the PR will be reviewed & merged if accepted

See my comment on the PR. I believe this is already possible via this feature (as per the docs):

You can combine both a default and label to your parameter but you must start with the label: $$paramName|label:defaultValue$$