How to Schedule Queries
Schedule your queries to run any time and automate your reporting. This feature is only available to Premium Team users.
Scheduling a query
To schedule your query, look for the Schedule Query
button under the name of your query.
That will open the scheduler modal:
- Under
Run Against
, choose your database connection. You can only schedule queries against a cloud connection. - Under
Run On
, you can schedule a query to run once at a specific day/time, or you can have it repeat every hour, day, week, etc. Next Run
gives you a preview of when PopSQL will run your query.
Variables
If your query has variables, you'll see a Variables
tab where you can create specify the value PopSQL should use when it runs your query. Multiple people can create multiple schedules with their own variable values. For example, your account managers might want to schedule the same query to run every morning, but with a different account_id
.
Notifications
On the Notifications
tab, you can specify when and where PopSQL should notify you when the scheduled query completes.
Notify on
Under Notify on
, you have three options:
Always
Every time the query runs, we'll send a notification.
If there are results
If there are one or more rows returned, we'll send a notification. Example: If your average order size is $100, you can tell PopSQL to alert you when you get an order that's > $500.
If there are no results
If there are zero rows returned, we'll send a notification. Example: If you're expecting user sign ups every hour, you can tell PopSQL to notify you if there are no sign ups in the last hour.
Channel
PopSQL can notify you via email or Slack.
If you set the channel to Email
, then you'll be prompted to specify some email recipients.
By default, the notification email will contain a link to see the results or download the CSV. If you prefer, you can also include the CSV as an attachment of the email:
Slack
If you set the channel to Slack
, then you'll be prompted to specify the Slack channels you want notified when the query completes.
Spread the word
Tweet