This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SQLite cursor.description is not DB-API compatible
Type: behavior Stage:
Components: Documentation Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: docs@python Nosy List: CharlieX, docs@python, ghaering, tshepang
Priority: normal Keywords:

Created on 2012-07-26 18:39 by CharlieX, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg166498 - (view) Author: Charlie Clark (CharlieX) Date: 2012-07-26 18:39
It says in the docs:
"""This read-only attribute provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are None."""

According to the DB-API, however, the first two items, name and type, must be specified:
"""
The first two items (name and type_code) are mandatory, the other five are optional and are set to None if no meaningful values can be provided.
"""

Even with it's limited number of types SQLite is typed and should be able to return the type for column.
msg166602 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2012-07-27 19:32
SQLite's columns aren't typed, only SQLite values are. So it's entirely possible for the same column to have different types, like the NULL type, the INTEGER type and the TEXT type.

It's thus impossible to give meaningful type information in a SQLite3 DB-API module. That's why it's set to None instead.
History
Date User Action Args
2022-04-11 14:57:33adminsetgithub: 59665
2012-07-27 19:32:30ghaeringsetstatus: open -> closed
resolution: wont fix
messages: + msg166602
2012-07-27 18:51:49pitrousetnosy: + ghaering
2012-07-27 18:43:27tshepangsetnosy: + tshepang, docs@python

components: + Documentation, - Library (Lib)
assignee: docs@python
2012-07-26 18:39:01CharlieXcreate