Opened 6 years ago
Closed 6 years ago
#29534 closed Cleanup/optimization (fixed)
Use rlwrap if available for oracle backend dbshell
Reported by: | Dan Davis | Owned by: | Dan Davis |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Mariusz Felisiak | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
PROBLEM
Oracle's SQL utility, sqlplus, is proprietary and closed source. On *NIX systems, it is not linked with GNU readline. So, using it in that environment is quite hard -- unless you use rlwrap. It is trivial to use rlwrap via an alias, but to get Django's manage.py dbshell to work properly requires changes to the backend.
DESIRED BEHAVIOR
The Oracle backend.client should look for rlwrap, and wrap sqlplus in rlwrap when rlwrap is available. If rlwrap is not available, then we will assume that's what there is.
Change History (9)
comment:1 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 6 years ago
Having worked on this briefly, I'm not really sure whether it is a good idea to support calling rlwrap if it is installed by hand - in that case, you can subclass the backend.
Both on CentOS 6, CentOS 7, and Ubuntu 16.04, the path to rlwrap is /usr/bin/rlwrap if it has been installed as a package.
So, the question is whether it is better to look for it in the path with shutil.which('rlwrap'), or whether it is better to only do this when it is "properly" installed in /usr/bin/rlwrap. I guess I should then check OS X, because there it may go elsewhere.
comment:3 by , 6 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.11 → master |
Hi Dan.
This seems a reasonable addition. (At least pending the work on the PR! :-)
Thanks for the input!
comment:4 by , 6 years ago
Type: | New feature → Cleanup/optimization |
---|
comment:6 by , 6 years ago
Cc: | added |
---|---|
Patch needs improvement: | set |
comment:7 by , 6 years ago
Patch needs improvement: | unset |
---|
comment:8 by , 6 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I think I can at least get as far as a pull request, but unit tests for Oracle may be tougher.