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 Dan Davis, 6 years ago

Owner: changed from nobody to Dan Davis
Status: newassigned

I think I can at least get as far as a pull request, but unit tests for Oracle may be tougher.

comment:2 by Dan Davis, 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 Carlton Gibson, 6 years ago

Triage Stage: UnreviewedAccepted
Version: 1.11master

Hi Dan.

This seems a reasonable addition. (At least pending the work on the PR! :-)

Thanks for the input!

comment:4 by Carlton Gibson, 6 years ago

Type: New featureCleanup/optimization

comment:5 by Tim Graham, 6 years ago

Has patch: set

comment:6 by Mariusz Felisiak, 6 years ago

Cc: Mariusz Felisiak added
Patch needs improvement: set

comment:7 by Mariusz Felisiak, 6 years ago

Patch needs improvement: unset

comment:8 by Tim Graham, 6 years ago

Triage Stage: AcceptedReady for checkin

comment:9 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In c6525bea:

Fixed #29534 -- Made dbshell use rlwrap on Oracle if available.

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