#82: The pgquery type should have a method listtypes()
-----------------------+-----------------
  Reporter:  cito      |      Owner:
      Type:  defect    |     Status:  new
  Priority:  major     |  Milestone:  5.2
 Component:  DB API 2  |    Version:  5.0
Resolution:            |   Keywords:
-----------------------+-----------------
Description changed by cito:

Old description:

> As suggested on the mailing list 2019-06-07 by Justin Pryzby:
>
> The query type of the `pg` module should have a method for exposing
> `col_types` (the column types) of the query to Python. Currently you can
> only get the number of results with `ntuples()` and the list of column
> names with `listfields()`. Note that `col_types` only has the result of
> `PQftype()`, it might be also interesing to get the type modifiers with
> `PQfmod()`.
>
> `pgdb` already provides this information in the `description` property
> via the `listinfo()` method of the underlying source object which uses
> the `_source_buildinfo` function.
>
> Instead of adding a new method, we should probably add a property that
> combines all of the information, like `description` in `pgdb`. Not sure
> if an ordered dict (simple dict in Py >= 3.6) with names as keys or a
> list of namedtuples like in `pgdb` would be better.

New description:

 As suggested on the mailing list 2019-06-07 by Justin Pryzby:

 The query type of the `pg` module should have a method for exposing
 `col_types` (the column types) of the query to Python. Currently you can
 only get the number of results with `ntuples()` and the list of column
 names with `listfields()`. Note that `col_types` only has the result of
 `PQftype()`, it might be also interesing to get the type modifiers with
 `PQfmod()`.

 `pgdb` already provides this information in the unofficial `coltypes`
 property and in combined form in the official `description` property. This
 is fetched via the `listinfo()` method of the underlying source object
 which uses the `_source_buildinfo` function.

 Instead or in addition to adding a new method, we should probably also add
 a property that combines all of the information, like `description` in
 `pgdb`. Not sure if an ordered dict (simple dict in Py >= 3.6) with names
 as keys or a list of namedtuples like in `pgdb` would be better.

--

--
Ticket URL: <http://trac.pygresql.org:8000/pgtracker/ticket/82#comment:1>
PyGreSQL <http://www.pygresql.org/>
PyGreSQL Tracker
_______________________________________________
PyGreSQL mailing list
PyGreSQL@Vex.Net
https://mail.vex.net/mailman/listinfo/pygresql

Reply via email to