Skip to content

Add mysql support #1

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
jmcopeland opened this issue Sep 6, 2022 · 2 comments
Open

Add mysql support #1

jmcopeland opened this issue Sep 6, 2022 · 2 comments

Comments

@jmcopeland
Copy link

Any clue what it might take to add mysql support?

@JaredStufftGD
Copy link
Owner

Hi Justin, sorry for the late response. Django by default uses the mysqlclient to connect to MySQL databases. This library doesn't have an explicit mogrify command (which the psycopg2 package for Postgres does have). I checked the execute method for the cursor object in mysqlclient and it looks like they compile the query string there: https://github.com/PyMySQL/mysqlclient/blob/main/MySQLdb/cursors.py

So probably would need to test the individual steps that they're doing in the execute method to combine the query template and the args, see if that generates the usable SQL we're looking for, and then creating a function to do the compile and add it as a backend to django-sql-compiler.

@jmcopeland
Copy link
Author

I found this open pull request to add mogrify support to mysqlclient PyMySQL/mysqlclient#477

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

No branches or pull requests

2 participants