Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

cursor is missing .description field #195

Open
gijzelaerr opened this issue Sep 6, 2017 · 2 comments
Open

cursor is missing .description field #195

gijzelaerr opened this issue Sep 6, 2017 · 2 comments

Comments

@gijzelaerr
Copy link
Contributor

https://www.python.org/dev/peps/pep-0249/#description

import monetdblite
conn_lite = monetdblite.connect('/tmp/test')
cur_lite = conn_lite.cursor()
print(cur_lite.execute('SELECT * from tables'))
print(cur_lite.description)
44
None
import pymonetdb
conn = pymonetdb.connect('test')
cur = conn.cursor()
print(cur.execute('SELECT * from sys.tables'))
print(cur.description)
51
[('id', 'int', None, 32, None, None, None), ('name', 'varchar', None, 1024, None, None, None), ('schema_id', 'int', None, 32, None, None, None), ('query', 'varchar', None, 2048, None, None, None), ('type', 'smallint', None, 16, None, None, None), ('system', 'boolean', None, 1, None, None, None), ('commit_action', 'smallint', None, 16, None, None, None), ('access', 'smallint', None, 16, None, None, None), ('temporary', 'tinyint', None, 8, None, None, None)]
@gijzelaerr
Copy link
Contributor Author

@gijzelaerr
Copy link
Contributor Author

gijzelaerr commented Sep 14, 2017

there are some missing things here, but at least there is a description field.

We could maybe extract a bit more information from the numpy types. Also the types need to be comparable to the dbapi types, which don't seem to be defined in the API also:

https://www.python.org/dev/peps/pep-0249/#type-objects

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant