Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DuckDB CronJob Extension
The DuckDB Cron extension adds support for scheduled query execution within DuckDB. It allows you to schedule SQL queries to run periodically using standard cron expressions while your DuckDB process is active.
Cron Runner
The function returns a job ID that can be used to manage the scheduled task.
┌──────────┐ │ job_id │ │ varchar │ ├──────────┤ │ task_0 │ └──────────┘
Supported Expressions
The extension uses six-field cron expressions:
Special characters:
*
: any value?
: no specific value (used in day-of-month/day-of-week),
: value list separator-
: range of values/
: step valuesMON-SUN
: named weekdays (case sensitive)Common Patterns:
Listing Jobs
Use the cron_jobs() table function to view all scheduled jobs and their status:
Returns:
job_id
: Unique identifier for the jobquery
: The SQL query to executeschedule
: The cron expressionnext_run
: Next scheduled execution timestatus
: Current status (Active/Inactive)last_run
: Last execution timestampDeleting Jobs
To delete a scheduled job: