Skip to content

How to set output format? #271

Answered by mahiki
mahiki asked this question in Q&A
Discussion options

You must be logged in to vote

OK -- I'm a python noob and probably most experienced python users would be able to figure out there is a Cursor field member that has the column headings, via trial and error.

I suggest this note gets added to the quickstart guide on README.

cur.description
[('week_end', 'date', None, None, None, None, None), ('metric_name', 'varchar', None, None, None, None, None), ('metric_value', 'bigint', None, None, None, None, None)]

I think the way to know this would be inspecting the cursor object:

dir(cur)
['__class__', '__delattr__', '__dict__', ... 'connection', 'description', 'execute', 'executemany', 'fetchall', 'fetchmany', 'fetchone', 'genall', 'info_uri', 'rowcount', 'setinputsizes', 'set…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mahiki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant