summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-03-01 20:24:02 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-03-01 20:24:02 +0000
commit77d6d31542ab2365f218d7305309d6c3468a36dc (patch)
tree91bddb1cf358f5c4145cb07d04db24902e08142a /lib/sqlalchemy/databases
parent8d295ec1189576f4ab918f8288812277567db6a1 (diff)
downloadsqlalchemy-77d6d31542ab2365f218d7305309d6c3468a36dc.tar.gz
- Added PGUuid and PGBit types to
sqlalchemy.databases.postgres. [ticket:1327] - Refection of unknown PG types won't crash when those types are specified within a domain. [ticket:1327] - executemany() in conjunction with INSERT..RETURNING is documented as undefined by psycopg2.
Diffstat (limited to 'lib/sqlalchemy/databases')
-rw-r--r--lib/sqlalchemy/databases/postgres.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index 8caadfaf8..038a9e8df 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -193,6 +193,14 @@ class PGBoolean(sqltypes.Boolean):
def get_col_spec(self):
return "BOOLEAN"
+class PGBit(sqltypes.TypeEngine):
+ def get_col_spec(self):
+ return "BIT"
+
+class PGUuid(sqltypes.TypeEngine):
+ def get_col_spec(self):
+ return "UUID"
+
class PGArray(sqltypes.MutableType, sqltypes.Concatenable, sqltypes.TypeEngine):
def __init__(self, item_type, mutable=True):
if isinstance(item_type, type):
@@ -283,6 +291,8 @@ ischema_names = {
'real' : PGFloat,
'inet': PGInet,
'cidr': PGCidr,
+ 'uuid':PGUuid,
+ 'bit':PGBit,
'macaddr': PGMacAddr,
'double precision' : PGFloat,
'timestamp' : PGDateTime,
@@ -527,6 +537,7 @@ class PGDialect(default.DefaultDialect):
elif attype == 'timestamp without time zone':
kwargs['timezone'] = False
+ coltype = None
if attype in ischema_names:
coltype = ischema_names[attype]
else:
@@ -540,8 +551,6 @@ class PGDialect(default.DefaultDialect):
# It can, however, override the default value, but can't set it to null.
default = domain['default']
coltype = ischema_names[domain['attype']]
- else:
- coltype = None
if coltype:
coltype = coltype(*args, **kwargs)