Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#31458 closed New feature (wontfix)

Allow changing executable_name for dbshell management command.

Reported by: minusf Owned by: nobody
Component: Core (Management commands) Version: 3.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is a proof of concept to make the dbshell executable configurable either in settings.py (DBSHELL_EXECUTABLE) or through an environment variable (DJANGO_DBSHELL_EXECUTABLE). The new executable must accept the same command line parameters.

If there is interest in this, i'll be happy to provide the bits for the other backends and the documentation.

$ DJANGO_DBSHELL_EXECUTABLE=pgcli python manage.py dbshell

https://github.com/django/django/pull/12709

Change History (6)

comment:1 by Mariusz Felisiak, 5 years ago

Easy pickings: unset
Resolution: wontfix
Status: newclosed
Summary: Allow changing executable_name for dbshell management commandAllow changing executable_name for dbshell management command.

I don't think that dbshell should support or respect different executable names, this can create a bunch of issues. You can always use different command by aliasing at system level or by subclassing the built-in database backends.

comment:2 by minusf, 5 years ago

just out of curiosity, could you list some of those issues?

comment:3 by Mariusz Felisiak, 5 years ago

For example inconsistency with supported arguments. I don't think we should maintain this and as I described above folks can use different executables if they really need to.

comment:4 by minusf, 5 years ago

sure, while it's not much code to add, it's a fairly niche itch to scratch i agree.

but your comment implies that this has numerous "potential issues" and the only one you can come up with is the one that the PR makes clear: only dropin replacements would be supported that take exactly the same command line arguments (which most "upgraded" shells always do).

Are there any other issues besides "do your customisation at home"?

comment:5 by Mariusz Felisiak, 5 years ago

I said "can create". It's not only about arguments but also about respecting environment variables.

You can start a discussion on DevelopersMailingList if you don't agree.

comment:6 by minusf, 5 years ago

nah, it's fine. i think it could be a better addition to django-extensions. thank you for looking into it.

Note: See TracTickets for help on using tickets.
Back to Top