Skip to content

Add MySQL/MariaDB support to the SQL mixin #2625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

creideiki
Copy link
Contributor

Add MySQL/MariaDB support using the PyMySQL module.

@sebix sebix added feature Indicates new feature requests or new features component: bots labels Jul 29, 2025
Copy link
Member

@sebix sebix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition, looks good to me.

Only the stylecheck complains on a small issue:

intelmq/lib/mixins/sql.py:133:5: E303 too many blank lines (2)

Is someone else able to test (ie. verify) the PR?

By default, MySQL and MariaDB uses double quotes (") to delimit string
literals. This contradicts ANSI SQL, which uses double quotes to quote
special characters in identifiers. The generic_db_lookup expert relies
on the ANSI behaviour. Set sql_mode=ANSI_QUOTES for MySQL and MariaDB
to make it behave like everything else.
The SQL mixin now handles SQLite, PostgreSQL, MSSQL, and MySQL/MariaDB.
Make sure all of these are mentioned in the documentation for all SQL
bots.
@creideiki
Copy link
Contributor Author

Only the stylecheck complains on a small issue:

intelmq/lib/mixins/sql.py:133:5: E303 too many blank lines (2)

Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: bots feature Indicates new feature requests or new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants