import pymssql as dbmodule
connect = dbmodule.connect
# pymmsql doesn't have a Binary method. we use string
- # updated: since v.74 binary support is fixed; restriction removed
- # dbmodule.Binary = lambda st: str(st)
+ dbmodule.Binary = lambda st: str(st)
def make_connect_string(keys):
if keys.get('port'):
# pymssql expects port as host:port, not a separate arg
else:
return value and True or False
-class MSPickle(sqltypes.PickleType):
- def get_col_spec(self):
- return "IMAGE"
-
colspecs = {
sqltypes.Integer : MSInteger,
sqltypes.Smallinteger: MSSmallInteger,
"""builds upon MetaData to provide the capability to bind to an Engine implementation."""
def __init__(self, engine_or_url, name=None, **kwargs):
super(BoundMetaData, self).__init__(name, **kwargs)
- self.rebind(engine_or_url, **kwargs)
- def is_bound(self):
- return True
- def rebind(self, engine_or_url, **kwargs):
if isinstance(engine_or_url, str):
self._engine = sqlalchemy.create_engine(engine_or_url, **kwargs)
else:
self._engine = engine_or_url
+ def is_bound(self):
+ return True
class DynamicMetaData(MetaData):
"""builds upon MetaData to provide the capability to bind to multiple Engine implementations
import string, re, random, sets
-__all__ = ['text', 'table', 'column', 'func', 'select', 'update', 'insert', 'delete', 'join', 'and_', 'or_', 'not_', 'between', 'between_', 'case', 'cast', 'union', 'union_all', 'except_', 'except_all', 'intersect', 'intersect_all', 'null', 'desc', 'asc', 'outerjoin', 'alias', 'subquery', 'literal', 'bindparam', 'exists', 'extract','AbstractDialect', 'ClauseParameters', 'ClauseVisitor', 'Executor', 'Compiled', 'ClauseElement', 'ColumnElement', 'ColumnCollection', 'FromClause', 'TableClause', 'Select', 'Alias', 'CompoundSelect','Join', 'Selectable']
+__all__ = ['text', 'table', 'column', 'func', 'select', 'update', 'insert', 'delete', 'join', 'and_', 'or_', 'not_', 'between_', 'case', 'cast', 'union', 'union_all', 'except_', 'except_all', 'intersect', 'intersect_all', 'null', 'desc', 'asc', 'outerjoin', 'alias', 'subquery', 'literal', 'bindparam', 'exists', 'extract','AbstractDialect', 'ClauseParameters', 'ClauseVisitor', 'Executor', 'Compiled', 'ClauseElement', 'ColumnElement', 'ColumnCollection', 'FromClause', 'TableClause', 'Select', 'Alias', 'CompoundSelect','Join', 'Selectable']
def desc(column):
"""return a descending ORDER BY clause element, e.g.: