Changeset 796 for trunk/docs


Ignore:
Timestamp:
Jan 28, 2016, 4:25:36 PM (4 years ago)
Author:
cito
Message:

Enrich type_code strings in the DB API 2

The type codes now carry e.g. the information whether a type is a record.
This allows to provide a RECORD type object that compares equal to all
kinds of records, similar to the already existing ARRAY type object.

Location:
trunk/docs/contents
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/contents/changelog.rst

    r795 r796  
    2727    The column names and types can now also be requested through the
    2828    colnames and coltypes attributes, which are not part of DB-API 2 though.
     29    The type_code provided by the description attribute is still equal to
     30    the PostgreSQL internal type name, but now carries some more information
     31    in additional attributes. The size, precision and scale information that
     32    is part of the description is now properly set for numeric types.
    2933  - If you pass a Python list as one of the parameters to a DB-API 2 cursor,
    3034    it is now automatically bound using an ARRAY constructor. If you pass a
  • trunk/docs/contents/pgdb/connection.rst

    r789 r796  
    8282.. attribute:: Connection.type_cache
    8383
    84     A dictionary with type information on the PostgreSQL types
     84    A dictionary with the various type codes for the PostgreSQL types
    8585
    86 You can request the dictionary either via type names or type OIDs.
     86You can request the dictionary either via a PostgreSQL type name (which
     87(is equal to the DB-API 2 *type_code*) or via a PostgreSQL type OIDs.
    8788
    88 The values are named tuples containing the following fields:
     89The values are *type_code* strings carrying additional attributes:
    8990
    9091        - *oid* -- the OID of the type
    91         - *name*  -- the type's name
    9292        - *len*  -- the internal size
    9393        - *type*  -- ``'b'`` = base, ``'c'`` = composite, ...
  • trunk/docs/contents/pgdb/types.rst

    r775 r796  
    157157    Used to describe ``json`` and ``jsonb`` columns
    158158
     159.. object:: ARRAY
     160
     161    Used to describe columns containing PostgreSQL arrays
     162
     163.. object:: RECORD
     164
     165    Used to describe columns containing PostgreSQL records
     166
    159167Example for using some type objects::
    160168
Note: See TracChangeset for help on using the changeset viewer.