return None
# Lazy initialization to avoid circular imports
-unitofwork.object_session = object_session
unitofwork._state_session = _state_session
from sqlalchemy.orm import mapper
mapper._expire_state = _expire_state
from sqlalchemy.sql.visitors import Visitable, cloned_traverse
import operator
-functions, schema, sql_util, sqltypes = None, None, None, None
-DefaultDialect, ClauseAdapter, Annotated = None, None, None
+functions, sql_util, sqltypes = None, None, None
+DefaultDialect = None
__all__ = [
'Alias', 'ClauseElement',
dictionary.
"""
- global Annotated
- if Annotated is None:
- from sqlalchemy.sql.util import Annotated
- return Annotated(self, values)
+ global sql_util
+ if sql_util is None:
+ from sqlalchemy.sql import util as sql_util
+ return sql_util.Annotated(self, values)
def _deannotate(self):
"""return a copy of this ClauseElement with an empty annotations
object, returning a copy of this :class:`FromClause`.
"""
- global ClauseAdapter
- if ClauseAdapter is None:
- from sqlalchemy.sql.util import ClauseAdapter
- return ClauseAdapter(alias).traverse(self)
+
+ global sql_util
+ if sql_util is None:
+ from sqlalchemy.sql import util as sql_util
+ return sql_util.ClauseAdapter(alias).traverse(self)
def correspond_on_equivalents(self, column, equivalents):
"""Return corresponding_column for the given column, or if None
# so that the resulting objects are pickleable.
annotated_classes = {}
-from sqlalchemy.sql import expression
for cls in expression.__dict__.values() + [schema.Column, schema.Table]:
if isinstance(cls, type) and issubclass(cls, expression.ClauseElement):
exec "class Annotated%s(Annotated, cls):\n" \
def create(self, bind=None, checkfirst=False):
"""Issue CREATE ddl for this type, if applicable."""
- from sqlalchemy.schema import _bind_or_error
if bind is None:
- bind = _bind_or_error(self)
+ bind = schema._bind_or_error(self)
t = self.dialect_impl(bind.dialect)
if t is not self and isinstance(t, SchemaType):
t.create(bind=bind, checkfirst=checkfirst)
def drop(self, bind=None, checkfirst=False):
"""Issue DROP ddl for this type, if applicable."""
- from sqlalchemy.schema import _bind_or_error
if bind is None:
- bind = _bind_or_error(self)
+ bind = schema._bind_or_error(self)
t = self.dialect_impl(bind.dialect)
if t is not self and isinstance(t, SchemaType):
t.drop(bind=bind, checkfirst=checkfirst)