diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-10 14:25:21 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-10 14:25:21 -0400 |
commit | ce2c4509176da6c125ec239931f05a946ac44d58 (patch) | |
tree | 6bc57993f236f06fbd6a6b1ac4a205490a5fc2a8 /lib/sqlalchemy/schema.py | |
parent | b7ecadfbde9a17eb32fc08d0e33f1a135de9ccc2 (diff) | |
download | sqlalchemy-ce2c4509176da6c125ec239931f05a946ac44d58.tar.gz |
- [feature] Added TIME type to mysql dialect,
accepts "fst" argument which is the new
"fractional seconds" specifier for recent
MySQL versions. The datatype will interpret
a microseconds portion received from the driver,
however note that at this time most/all MySQL
DBAPIs do not support returning this value.
[ticket:2534]
- attempted to modernize the types tests in test_mysql a little, though has a long
way to go
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r-- | lib/sqlalchemy/schema.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 859ccd99b..44072cd12 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -2767,10 +2767,17 @@ class ThreadLocalMetaData(MetaData): class SchemaVisitor(visitors.ClauseVisitor): """Define the visiting for ``SchemaItem`` objects.""" - __traverse_options__ = {'schema_visitor':True} + __traverse_options__ = {'schema_visitor': True} -class DDLElement(expression.Executable, expression.ClauseElement): +class _DDLCompiles(expression.ClauseElement): + def _compiler(self, dialect, **kw): + """Return a compiler appropriate for this ClauseElement, given a + Dialect.""" + + return dialect.ddl_compiler(dialect, self, **kw) + +class DDLElement(expression.Executable, _DDLCompiles): """Base class for DDL expression constructs. This class is the base for the general purpose :class:`.DDL` class, @@ -3004,11 +3011,6 @@ class DDLElement(expression.Executable, expression.ClauseElement): s.__dict__ = self.__dict__.copy() return s - def _compiler(self, dialect, **kw): - """Return a compiler appropriate for this ClauseElement, given a - Dialect.""" - - return dialect.ddl_compiler(dialect, self, **kw) class DDL(DDLElement): """A literal DDL statement. @@ -3240,7 +3242,7 @@ class _DropView(_CreateDropBase): """ __visit_name__ = "drop_view" -class CreateColumn(visitors.Visitable): +class CreateColumn(_DDLCompiles): """Represent a :class:`.Column` as rendered in a CREATE TABLE statement, via the :class:`.CreateTable` construct. |