via a new postgres.PGDoublePrecision object.
This is postgresql.DOUBLE_PRECISION in 0.6.
[ticket:1085]
subclass table to the query separately producing a
cartesian product. An example is in the ticket
description. [ticket:1543]
+
+- postgresql
+ - Added support for reflecting the DOUBLE PRECISION type,
+ via a new postgres.PGDoublePrecision object.
+ This is postgresql.DOUBLE_PRECISION in 0.6.
+ [ticket:1085]
0.5.6
=====
class PGUuid(sqltypes.TypeEngine):
def get_col_spec(self):
return "UUID"
+
+class PGDoublePrecision(sqltypes.Float):
+ def get_col_spec(self):
+ return "DOUBLE PRECISION"
class PGArray(sqltypes.MutableType, sqltypes.Concatenable, sqltypes.TypeEngine):
def __init__(self, item_type, mutable=True):
sqltypes.Smallinteger : PGSmallInteger,
sqltypes.Numeric : PGNumeric,
sqltypes.Float : PGFloat,
+ PGDoublePrecision : PGDoublePrecision,
sqltypes.DateTime : PGDateTime,
sqltypes.Date : PGDate,
sqltypes.Time : PGTime,
'uuid':PGUuid,
'bit':PGBit,
'macaddr': PGMacAddr,
- 'double precision' : PGFloat,
+ 'double precision' : PGDoublePrecision,
'timestamp' : PGDateTime,
'timestamp with time zone' : PGDateTime,
'timestamp without time zone' : PGDateTime,
numericprec, numericscale = charlen.split(',')
charlen = False
if attype == 'double precision':
- numericprec, numericscale = (53, False)
+ numericprec, numericscale = (True, False)
charlen = False
if attype == 'integer':
numericprec, numericscale = (32, 0)
eq_(c.construct_params(params), checkparams)
class ComparesTables(object):
- def assert_tables_equal(self, table, reflected_table):
+ def assert_tables_equal(self, table, reflected_table, strict_types=False):
base_mro = sqltypes.TypeEngine.__mro__
assert len(table.c) == len(reflected_table.c)
for c, reflected_c in zip(table.c, reflected_table.c):
assert reflected_c is reflected_table.c[c.name]
eq_(c.primary_key, reflected_c.primary_key)
eq_(c.nullable, reflected_c.nullable)
- assert len(
- set(type(reflected_c.type).__mro__).difference(base_mro).intersection(
- set(type(c.type).__mro__).difference(base_mro)
- )
- ) > 0, "Type '%s' doesn't correspond to type '%s'" % (reflected_c.type, c.type)
+ if strict_types:
+ assert type(reflected_c.type) is type(c.type), "Type '%s' doesn't correspond to type '%s'" % (reflected_c.type, c.type)
+ else:
+ assert len(
+ set(type(reflected_c.type).__mro__).difference(base_mro).intersection(
+ set(type(c.type).__mro__).difference(base_mro)
+ )
+ ) > 0, "Type '%s' doesn't correspond to type '%s'" % (reflected_c.type, c.type)
if isinstance(c.type, sqltypes.String):
eq_(c.type.length, reflected_c.type.length)
Column('flag', postgres.PGBit),
Column('addr', postgres.PGInet),
Column('addr2', postgres.PGMacAddr),
- Column('addr3', postgres.PGCidr)
+ Column('addr3', postgres.PGCidr),
+ Column('doubleprec', postgres.PGDoublePrecision)
)
metadata.create_all()
m = MetaData(testing.db)
t = Table('sometable', m, autoload=True)
- self.assert_tables_equal(table, t)
+ self.assert_tables_equal(table, t, strict_types=True)
class MatchTest(TestBase, AssertsCompiledSQL):