Show
Ignore:
Timestamp:
03/10/07 00:21:37 (2 years ago)
Author:
mfenniak
Message:

Add float and decimal output types

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pg8000/trunk/pg8000.py

    r825 r827  
    12071207        return float(data) 
    12081208 
     1209    def float8send(v, **kwargs): 
     1210        return struct.pack("!d", v) 
     1211 
    12091212    # The timestamp_recv function is sadly not in use because some PostgreSQL 
    12101213    # servers are compiled with HAVE_INT64_TIMESTAMP, and some are not.  This 
     
    12781281        str: {"tid": 25, "txt_out": textout}, 
    12791282        unicode: {"tid": 25, "txt_out": textout}, 
     1283        float: {"tid": 701, "bin_out": float8send}, 
     1284        decimal.Decimal: {"tid": 1700, "txt_out": numeric_out}, 
    12801285        type(None): {"tid": -1}, 
    12811286    }