Scheduled Queries
Run SQL queries automatically on a cron schedule, with run history and desktop notifications
Scheduled Queries
Schedule queries to run automatically at recurring intervals. Useful for monitoring, periodic data checks, or generating recurring reports.
Where Watch Mode re-runs a query while you’re looking at it, Scheduled Queries keep running on their own cadence in the background — so you can leave a “how many signups today?” or “any rows stuck in pending?” check ticking over and get a desktop ping when it completes, without babysitting a tab.
Creating a Schedule
- Open the Scheduled Queries dialog from the sidebar
- Click New Schedule
- Configure the schedule:
- Name — a descriptive label
- Connection — which database to run against
- SQL — the query to execute
- Schedule — choose a preset or enter a custom cron expression
Schedule Presets
| Preset | Cron |
|---|---|
| Every minute | * * * * * |
| Every 5 minutes | */5 * * * * |
| Every hour | 0 * * * * |
| Every day at midnight | 0 0 * * * |
| Custom | Any valid cron expression |
Managing Schedules
Pause / Resume
Click the pause button to temporarily stop a schedule without deleting it. Click again to resume.
Run Now
Trigger an immediate execution outside the schedule.
View Run History
Click a schedule to see all past runs with:
- Execution timestamp
- Duration
- Row count or error message
- Success/failure status
Notifications
When a scheduled query completes, data-peek sends a desktop notification with the result summary.
Example: an hourly backlog check
Create a schedule named Pending invoices, pick your connection, set the cron to 0 * * * * (every hour), and use:
SELECT count(*) AS pending FROM invoices WHERE status = 'pending';Each hour you get a notification with the count, and the run history keeps a timestamped record you can scan for the moment the number started climbing. Need a custom cadence like every 15 minutes? Use */15 * * * *.
Scheduled queries only run while data-peek is open. They do not run in the background after quitting the app — for always-on jobs use a server-side scheduler (cron, pg_cron, etc.).
Related
- Watch Mode — live-refresh a query while you watch it
- Query Telemetry — see where a slow scheduled query spends its time
- Health Monitor — live view of active queries, locks, and table sizes