fix: implement MySQL scheduler methods#7354
Open
kaiisfree wants to merge 2 commits intoagno-agi:mainfrom
Open
Conversation
Add missing scheduler methods to MySQLDb and AsyncMySQLDb backends: - get_schedule, get_schedule_by_name, get_schedules - create_schedule, update_schedule, delete_schedule - claim_due_schedule, release_schedule - create_schedule_run, update_schedule_run, get_schedule_run, get_schedule_runs Key MySQL-specific adaptations: - claim_due_schedule uses SELECT...FOR UPDATE SKIP LOCKED + UPDATE (MySQL doesn't support UPDATE...RETURNING) - JSON type instead of JSONB - Explicit VARCHAR lengths for indexed columns Also adds schedule and schedule_runs table schemas to MySQL schema definitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
PR TriageMissing tests: This PR modifies source code but does not include any test changes. Please add or update tests to cover your changes. |
Cover schedule CRUD (get/create/update/delete), claim/release atomicity with SELECT FOR UPDATE, schedule runs, pagination, and schema definitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Tests were added in the second commit ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
MySQLDbandAsyncMySQLDbbackendsschedulesandschedule_runstable schema definitions for MySQLChanges
libs/agno/agno/db/mysql/schemas.pySCHEDULE_TABLE_SCHEMAwith MySQL-compatible types (JSON, VARCHAR with explicit lengths)_get_schedule_runs_table_schema()with FK reference to schedules tableget_table_schema_definition()to handle new table typeslibs/agno/agno/db/mysql/mysql.py(sync)schedulesandschedule_runsto_get_table()get_schedule,get_schedule_by_name,get_schedules,create_schedule,update_schedule,delete_schedule,claim_due_schedule,release_schedule,create_schedule_run,update_schedule_run,get_schedule_run,get_schedule_runslibs/agno/agno/db/mysql/async_mysql.py(async)MySQL-specific adaptations
claim_due_schedule: UsesSELECT...FOR UPDATE SKIP LOCKED+UPDATEin a transaction (MySQL doesn't supportUPDATE...RETURNING)JSONtype instead ofJSONBVARCHARlengths for indexed string columnsTest plan
claim_due_scheduleconcurrent safety withSKIP LOCKEDdelete_schedulecascades to schedule_runs🤖 Generated with Claude Code