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

Sql explorer save query params #489

Conversation

dwmorrison33
Copy link

Description

This provides the functionality to save query params so that the queries execute with them each time one comes to the Query Detail page.

Resolves: #482

Deployment Procedures

  • Migration (Please specify app(s) below)
    • ./manage.py migrate explorer

Tests

Execute Manual UI Tests like the following:

  1. Create a new query with a query param and save, note the same functionality exists as previously where the query does not execute due to no value for the new param:

Screen Shot 2022-09-06 at 2 57 16 PM

  1. Input a value for the parameter and save:

Screen Shot 2022-09-06 at 2 57 35 PM

  1. Now add a new parameter and save:

Screen Shot 2022-09-06 at 2 58 27 PM

  1. Now save a new value to the second parameter:

Screen Shot 2022-09-06 at 2 58 47 PM

  1. Now navigate back to the Query List page and click on the test query:

Screen Shot 2022-09-06 at 2 59 10 PM

  1. Validate that the new QueryParams persist and the query executed:

Screen Shot 2022-09-06 at 2 59 35 PM

Also, you will want to verify that the csv and JSON exports still work correctly like:

Screen Shot 2022-09-06 at 3 04 05 PM

Screen Shot 2022-09-06 at 3 04 22 PM

@dwmorrison33 dwmorrison33 mentioned this pull request Sep 6, 2022
1 task
@dwmorrison33
Copy link
Author

Note: This is tested with Python3.8 and Django3.2

@dwmorrison33
Copy link
Author

It looks like I need to update some tests and there is one change I think will be best when creating/deleting the query parameters. Will try to get to those today.

@marksweb
Copy link
Collaborator

marksweb commented Sep 7, 2022

@dwmorrison33 yeah I've not had time to look at the tests but think I saw a change to the way the params attribute works in the view

@chrisclark
Copy link
Collaborator

Whoa whoa whoa -- there actually IS a way to do this! The param syntax supports providing a default value. 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$$.

Does that hit the bid?

@dwmorrison33
Copy link
Author

Whoa whoa whoa -- there actually IS a way to do this! The param syntax supports providing a default value. 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.

Does that hit the bid?

@chrisclark Thank you for the info, but this PR is stale. I’m thankful we didn’t move forward with this request last year, I will close this PR now.

@dwmorrison33 dwmorrison33 deleted the sql-explorer-query-params branch December 15, 2023 19:38
@chrisclark
Copy link
Collaborator

All good! I really appreciate you taking the time and sorry it took uh...a year to weigh in.

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.

3 participants