summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-10-25 00:40:34 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-10-25 00:40:34 +0000
commitaa557982fa2518e6d520ce17894093d5ed03c0eb (patch)
tree5bc55ac2aa8d33de635c380f775e642c52bc7d8c /lib/sqlalchemy/sql/compiler.py
parent82ea898ab06063ebac631f4e375331550a226687 (diff)
downloadsqlalchemy-aa557982fa2518e6d520ce17894093d5ed03c0eb.tar.gz
- Added new ENUM type to the Postgresql dialect, which exists as a schema-level
construct and extends the generic Enum type. Automatically associates itself with tables and their parent metadata to issue the appropriate CREATE TYPE/DROP TYPE commands as needed, supports unicode labels, supports reflection. [ticket:1511] - MySQL ENUM now subclasses the new generic Enum type, and also handles unicode values implicitly, if the given labelnames are unicode objects. - Added a new Enum generic type, currently supported on Postgresql and MySQL. Enum is a schema-aware object to support databases which require specific DDL in order to use enum or equivalent; in the case of PG it handles the details of `CREATE TYPE`, and on other databases without native enum support can support generation of CHECK constraints. [ticket:1109] [ticket:1511] - types documentation updates - some cleanup on schema/expression docs
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 5f5b31c68..c1b421843 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1246,6 +1246,9 @@ class GenericTypeCompiler(engine.TypeCompiler):
def visit_unicode_text(self, type_):
return self.visit_TEXT(type_)
+ def visit_enum(self, type_):
+ raise NotImplementedError("Enum not supported generically")
+
def visit_null(self, type_):
raise NotImplementedError("Can't generate DDL for the null type")
@@ -1264,7 +1267,8 @@ class IdentifierPreparer(object):
illegal_initial_characters = ILLEGAL_INITIAL_CHARACTERS
- def __init__(self, dialect, initial_quote='"', final_quote=None, escape_quote='"', omit_schema=False):
+ def __init__(self, dialect, initial_quote='"',
+ final_quote=None, escape_quote='"', omit_schema=False):
"""Construct a new ``IdentifierPreparer`` object.
initial_quote