feat: Add MySQL and MariaDB support for SqlStorageClient#1749
Open
Mantisus wants to merge 5 commits intoapify:masterfrom
Open
feat: Add MySQL and MariaDB support for SqlStorageClient#1749Mantisus wants to merge 5 commits intoapify:masterfrom
MySQL and MariaDB support for SqlStorageClient#1749Mantisus wants to merge 5 commits intoapify:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds MySQL and MariaDB support to SqlStorageClient, expanding the database backend options beyond SQLite and PostgreSQL. The implementation includes database-specific configurations, SQL dialect handling, and special error handling for MariaDB's unique locking behavior.
Changes:
- Added
sql_mysqloptional dependency group with aiomysql, cryptography, and SQLAlchemy - Implemented MySQL/MariaDB-specific SQL operations (INSERT IGNORE, ON DUPLICATE KEY UPDATE)
- Added MariaDB-specific error handling for locked rows (error 1020)
- Updated documentation to include installation and configuration instructions for MySQL/MariaDB
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Added aiomysql 0.3.2, cryptography 46.0.5, and pymysql 1.1.2 dependencies; updated package metadata to include sql-mysql extra |
| pyproject.toml | Added sql_mysql optional dependency group with required packages |
| src/crawlee/storage_clients/_sql/_storage_client.py | Extended dialect validation to include mysql/mariadb; added MySQL/MariaDB-specific engine configuration (connect_timeout, READ COMMITTED isolation level) |
| src/crawlee/storage_clients/_sql/_request_queue_client.py | Reorganized transaction handling; enabled skip_locked for MySQL/MariaDB in fetch operations |
| src/crawlee/storage_clients/_sql/_client_mixin.py | Implemented MySQL/MariaDB insert-with-ignore and upsert statements; added MariaDB error 1020 handling for locked rows |
| docs/guides/storage_clients.mdx | Updated documentation to include MySQL/MariaDB in supported databases; added installation instructions and configuration warnings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Description
MySQLandMariaDBsupport forSqlStorageClient.Issues
SqlStorageClient#1405