#1631 closed enhancement (fixed)
[patch] django-admin.py dbclient: execute psql/mysql/sqlite3 client using project's DB settings
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | magic-removal |
Severity: | trivial | 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
OK, so I'm just scratching my own itch with this patch but I'm hoping others find it useful. If it needs to be kicked to the mailing list for more discussion that's fine.
It adds a command, django-admin.py dbclient (or manage.py dbclient) that launches the appropriate command-line client (psql, mysql, sqlite3) using DATABASE_* settings from the active settings file.
Note: I have tested this only on MySQL and SQLite back-ends -- I don't have a running PostgreSQL install, though I am fairly sure the command structure is correct. Nonetheless, testing is of course appreciated.
Attachments (1)
Change History (4)
by , 19 years ago
Attachment: | dbclient.patch added |
---|
comment:1 by , 19 years ago
Oooh! This is very cool, Paul! The one obvious imperfection is that it assumes the command-line clients are on the system path, but I think that's not too horrible of a requirement to use this feature.
comment:2 by , 19 years ago
Yeah, that seemed like an acceptable blemish to me given the alternatives. Glad you like it!
A sensible improvement would be to check for existence of the binaries before trying to invoke them, for nicer errors if nothing else. In Unix I'd do this with "which" but don't know a Windows/portable solution.
comment:3 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
patch