MySQL: manage.py dbshell does not get charset from DATABASES setting
|Reported by:||Tom Vergote||Owned by:|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||julie@…, victoria@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
I noticed that manage.py dbshell doesn't respect the database_options.
I ran into an issue with an application we are creating that needs to support mysql and postgre at least, we execute some sql scripts that get piped to manage.py dbshell (to avoid hardcoding psql -U xxx or mysql -u xxx and creating 2 scripts every time).
When running an utf8 database with utf8 as our charset in database_options, we ran into some weird encoding issues.
The solution for us was to learn mysql/client.py to respect the encoding settings in settings.py
Are you opposed to something like this?
Attaching small patch that fixes our problem. Let me know if it needs extending to support other backends or database_options.
Change History (12)
comment:2 Changed 9 years ago by
|Summary:||manage.py dbshell doesn't respect database_options → manage.py dbshell does not get charset from database_options|
comment:5 Changed 5 years ago by
|Triage Stage:||Design decision needed → Accepted|
comment:9 Changed 17 months ago by
|Owner:||changed from nobody to Victoria Martínez de la Cruz|
|Status:||new → assigned|
comment:10 Changed 16 months ago by
|Summary:||manage.py dbshell does not get charset from database_options → MySQL: manage.py dbshell does not get charset from DATABASES setting|