#18332: No generic way to get database backend version
-------------------------------------+-------------------------------------
Reporter: apollovy@… | Owner:
| vanessagomes
Type: Bug | Status: new
Component: Database layer | Version: 1.3
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Michiel Beijen):
I created a pull request here:
https://github.com/django/django/pull/8521
I took the old patch attached to this ticket and brushed it up a bit. To
the original SQLite implementation I added PostgreSQL, MySQL and Oracle
implementations.
We also no longer return a namedtuple but a dict instead because it feels
more in line with the rest of Django.
The thing I'm unsure about is if it would not be better to have the
'vendor' be the 'vendor' and a 'type' that can indicate the type. For
instance for MySQL there is MySQL and MariaDB with each their own version
numbering schemes.
This provides an option
{{{
get_backend_info()
}}}
that allows you to retrieve the database type (vendor) and version, as a
tuple.
{{{
>>> from django.db import connection
>>> connection.backend_info()
{'vendor': 'postgresql', 'version': (9, 6, 2)}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/18332#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/076.a705409fbef01db1a70421d5435a8517%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.