explorerhq / django-sql-explorer

Easily share data across your company via SQL queries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make one query run every day at 18pm

opened this issue · comments

Hi guys,

How can i implement this query to run everyday at 18pm.?
SELECT *
FROM parcare_parking
WHERE parking_on = date('now','+1 day');

I was not able to find/follow these steps. If you can put some images, i would owe you a lot!

Snapshots
Tick the 'snapshot' box on a query, and Explorer will upload a .csv snapshot of the query results to S3. Configure the snapshot frequency via a celery cron task, e.g. for daily at 1am:
'explorer.tasks.snapshot_queries': {
    'task': 'explorer.tasks.snapshot_queries',
    'schedule': crontab(hour=1, minute=0)
}
Requires celery, obviously. Also uses djcelery and tinys3. All of these deps are optional and can be installed with pip install -r optional-requirements.txt
The checkbox for opting a query into a snapshot is ALL THE WAY on the bottom of the query view (underneath the results table).
Email query results
Click the email icon in the query listing view, enter an email address, and the query results (zipped .csv) will be sent to you asynchronously. Very handy for long-running queries.

Sure, it's here:
image

You have to have the setting EXPLORER_TASKS_ENABLED enabled as well. I should probably add that to the steps :)