manage.py dbshell does not get charset from database_options
|Reported by:||tvrg||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|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 (9)
Changed 7 years ago by tvrg
comment:1 Changed 7 years ago by tvrg
- Has patch set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 7 years ago by tvrg
- Summary changed from manage.py dbshell doesn't respect database_options to manage.py dbshell does not get charset from database_options
comment:3 Changed 7 years ago by Simon Greenhill <dev@…>
- Triage Stage changed from Unreviewed to Design decision needed
comment:5 Changed 4 years ago by carljm
- Easy pickings unset
- Triage Stage changed from Design decision needed to Accepted
- UI/UX unset
comment:7 Changed 3 years ago by jpichon
- Triage Stage changed from Accepted to Design decision needed