SQL Events
The Events activity manages scheduled SQL jobs — server-side routines triggered on a recurring interval or a one-off timestamp. It is designed for the MySQL/MariaDB event scheduler and equivalent time-driven mechanisms on other dialects. Use it to automate housekeeping (log pruning, cache rebuilds, aggregate rollups) without leaving VisuaLeaf.
EVERY or one-time AT), and fill in the timing fields.BEGIN ... END block.The form exposes every option the underlying CREATE EVENT DDL accepts:
| Field | Purpose |
|---|---|
| Name | Identifier used to drop or ALTER the event later. |
| Schedule | Recurring (EVERY) or One-time (AT). |
| Every | Numeric interval + unit (SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR). |
| Starts | Optional first execution timestamp (recurring events). |
| Ends | Optional last-run boundary. |
| Execute at | Single-shot execution timestamp (one-time events). |
| SQL Body | The statement(s) to run when the event fires. |
CREATE EVENT purge_stale_logs
ON SCHEDULE EVERY 1 DAY
STARTS '2026-07-15 02:00:00'
ENDS '2027-07-15 02:00:00'
DO
DELETE FROM logs WHERE created_at < NOW() - INTERVAL 30 DAY;
CREATE EVENT nightly_reindex_2026_07_15
ON SCHEDULE AT '2026-07-15 03:00:00'
DO
OPTIMIZE TABLE orders;
Every event in the database appears as its own card in the list. Each card shows the event name and a Drop action. Dropping asks for confirmation, then executes DROP EVENT.
SHOW VARIABLES LIKE 'event_scheduler'; and enable it with SET GLOBAL event_scheduler = ON;.EVENT privilege on the database.pg_cron, SQL Server uses SQL Agent jobs, Oracle uses DBMS_SCHEDULER. Where the driver exposes these as events, they are surfaced here; otherwise the activity is disabled.evt_daily_..., evt_hourly_....BEGIN ... END; the editor accepts either form.DISABLE state via the SQL Editor while you validate — you can re-enable with ALTER EVENT ... ENABLE.EVENT privilege.Download and start managing your MongoDB databases with ease.
Download Free Trial