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.
--
Ticket URL: <https://code.djangoproject.com/ticket/29534>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* owner: nobody => Dan Davis
Comment:
I think I can at least get as far as a pull request, but unit tests for
Oracle may be tougher.
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:1>
Comment (by Dan Davis):
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:2>
* version: 1.11 => master
* stage: Unreviewed => Accepted
Comment:
Hi Dan.
This seems a reasonable addition. (At least pending the work on the PR!
:-)
Thanks for the input!
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:3>
* type: New feature => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:4>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/10106 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:5>
* cc: felixxm (added)
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:6>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:7>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c6525bea9ec3d1d1e73585ca6e3116bb55afb336" c6525bea]:
{{{
#!CommitTicketReference repository=""
revision="c6525bea9ec3d1d1e73585ca6e3116bb55afb336"
Fixed #29534 -- Made dbshell use rlwrap on Oracle if available.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:9>