SQL Request
Overview
The Workflow feature simplifies the process of requesting authorization for running queries, whether they are unathorized or require approval. Upon approval by the designated approver, the executor is granted permission to execute the approved query once and view the results.
SQL Request
Navigate to the Workflow tab in the top menu of the web page.
Click on the
Submit Request
button located in the top left corner, and then select theSQL Request
type.The Create SQL Request page will be displayed.
Select Approval Rule
At the top of the SQL Request page, select an Approval Rule to govern the approval process.
If you select
Default (No Rule)
, users can choose their own approvers.Approvers can be automatically added to the Approvers field when an admin selects a preset approval rule..
Add approvers
Approvers can be added directly by the requester based on the approval rules set up by the admin. Click the + button in the box, and a popup will appear allowing you to add an approver.
If you've selected a approval rule that doesn't allow the requester to select an approver themselves, then the + button won't appear, and the box will be grayed out, indicating it cannot be clicked. In this case, the name of the approver set by the admin is automatically displayed.
Condition of Approval : Select an approval condition.
A single Assignee can complete the approval request : The workflow ends when one of the selected approvers approves.
All Assignees must approve this request : All selected approvers must approve the request to end the workflow. (All approvals are required regardless of the order of approval.)
Assignees : Select the approvers for the request.
Once all approvers are selected, click the
Save
button in the bottom right corner of the popup to save the selections.Urgent Mode : If post-approval is allowed according to the approval rule, you can register requests with the post-approval option.
Write an SQL Execution Request
Title : Provide a subject for the request.
Connection : Select the target database to request SQL execution.
Users can only select databases they have access to at the time of the request.
Database : Select the logical schema within the selected database where you want the SQL execution to occur.
Content Type : Choose the content type for entering the SQL syntax.
Text : Write your own queries in the Queries section within the request page.
File : Upload your query as a file.
Target Date : Set the date for when you want this query to run. The default selection is the day of the request.
Due Date : Set the date for when the approval or execution expires. The default selection is one year from now.
Comments : Provide a reason or justification for requesting to run the SQL in the designated database.
Click
Save
to submit your SQL request.
Once your request is successfully saved and submitted, you can track your request history and approval status in the Workflow > Sent Request > In Progress section.
Run the Approved SQL Request
Once approved, the SQL request is in a state where it can be executed.
Navigate to the Workflow > Executions > To Do menu.
Locate the SQL request pending execution and click on it to view its detail page.
After reviewing the details of the SQL request, click the
Execute
button on the top right to execute it. Alternatively, you can click theCancel
button to cancel the request.After the execution is complete, you can view the success or failure status on the Results tab within the details page.
You can access the history of requests for which you are the executor in the Workflow > Received Requests > Done menu.
Notes on Running Large Queries
If you are running a large query using an SQL Request, it will continue to run in the background on the QueryPie server even if you close your web browser. To check the progress of queries running in the background:
Reconnect to QueryPie after closing your web browser.
Navigate to the SQL Request detail page again.
You will be able to view the progress of the background query execution on the detail page. (Supported in QueryPie versions 9.15.0 and later)
Related Topics