Changeset 821 for trunk/pg.py


Ignore:
Timestamp:
Feb 5, 2016, 11:13:54 AM (3 years ago)
Author:
cito
Message:

Support the uuid data type

This is often useful and also supported by SQLAlchemy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pg.py

    r820 r821  
    4343from re import compile as regex
    4444from json import loads as jsondecode, dumps as jsonencode
     45from uuid import UUID
    4546
    4647try:
     
    180181        'float': 'float4 float8',
    181182        'int': 'cid int2 int4 int8 oid xid',
    182         'hstore': 'hstore', 'json': 'json jsonb',
    183         'num': 'numeric',
    184         'money': 'money',
     183        'hstore': 'hstore', 'json': 'json jsonb', 'uuid': 'uuid',
     184        'num': 'numeric', 'money': 'money',
    185185        'text': 'bpchar char name text varchar'}
    186186
     
    864864        'time': cast_time, 'timetz': cast_timetz,
    865865        'timestamp': cast_timestamp, 'timestamptz': cast_timestamptz,
    866         'int2vector': cast_int2vector,
     866        'int2vector': cast_int2vector, 'uuid': UUID,
    867867        'anyarray': cast_array, 'record': cast_record}
    868868
Note: See TracChangeset for help on using the changeset viewer.