Skip to content
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

Enable foreign key constraints only in SQLite connections #13

Conversation

TheophileDiot
Copy link
Contributor

Description

This PR addresses compatibility concerns with SQLite connections by ensuring that the PRAGMA command is executed exclusively for SQLite databases. Without this fix, executing the PRAGMA command indiscriminately poses compatibility issues with MariaDB and MySQL.

Changes Made

Modified Files

  • src/cscapi/sql_storage.py: Modified the set_sqlite_pragma function to include a conditional check, ensuring that the PRAGMA command is executed only for SQLite connections.

@julienloizelet
Copy link
Collaborator

Thanks !

@julienloizelet julienloizelet merged commit 0c9833e into crowdsecurity:main Feb 7, 2024
2 checks passed
julienloizelet pushed a commit to julienloizelet/crowdsec-python-capi-sdk that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants