Ignore:
Timestamp:
Jan 30, 2016, 2:55:18 PM (4 years ago)
Author:
cito
Message:

Port type cache and typecasting from pgdb to pg

So far, the typecasting in the classic module was been only done by
the C extension module and was not extensible through typecasting
functions in Python. This has now been made extensible by adding
a cast hook to the C extension module which has been hooked up to
a new type cache object that holds information on the types and the
associated typecast functions. All of this works very similar to the
pgdb module now, except that the basic types are still handled by
the C extension module and the Python typecast functions are only
called via the hook for types which are not supported internally.

Also added tests and a chapter on the type cache in the documentation,
and cleaned up the error messages in the C extension module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/contents/pgdb/module.rst

    r797 r798  
    4747
    4848PyGreSQL provides built-in typecast functions for the common database types,
    49 but if you want to change these or add more typecast functions, you can use
    50 the following functions.
     49but if you want to change these or add more typecast functions, you can set
     50these up using the following functions.
    5151
    5252.. note::
     
    9090:meth:`TypeCache.get_typecast`, :meth:`TypeCache.set_typecast` and
    9191:meth:`TypeCache.reset_typecast` of the :attr:`Connection.type_cache`.  This
    92 will not affect other connections or future connections. In order to be sure
     92will not affect other connections or future connections.  In order to be sure
    9393a global change is picked up by a running connection, you must reopen it or
    9494call :meth:`TypeCache.reset_typecast` on the :attr:`Connection.type_cache`.
Note: See TracChangeset for help on using the changeset viewer.