summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/base.py
diff options
context:
space:
mode:
authorDiana Clarke <diana.joan.clarke@gmail.com>2012-11-19 23:29:08 -0500
committerDiana Clarke <diana.joan.clarke@gmail.com>2012-11-19 23:29:08 -0500
commit014e9128546a0c32cdd90ad5ccdcc21269987ee0 (patch)
tree915a9c89a5d3cd5d914867b3ab628c5f6f33bd8b /lib/sqlalchemy/dialects/mysql/base.py
parente0dc5ed803de7a57de033c16f2fa0044b59ce374 (diff)
downloadsqlalchemy-014e9128546a0c32cdd90ad5ccdcc21269987ee0.tar.gz
juts a 'expected 2 blank lines' pep8 pass
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/base.py33
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py
index 92c6f58a0..fa874ac5b 100644
--- a/lib/sqlalchemy/dialects/mysql/base.py
+++ b/lib/sqlalchemy/dialects/mysql/base.py
@@ -361,6 +361,7 @@ class _NumericType(object):
self.zerofill = zerofill
super(_NumericType, self).__init__(**kw)
+
class _FloatType(_NumericType, sqltypes.Float):
def __init__(self, precision=None, scale=None, asdecimal=True, **kw):
if isinstance(self, (REAL, DOUBLE)) and \
@@ -375,11 +376,13 @@ class _FloatType(_NumericType, sqltypes.Float):
super(_FloatType, self).__init__(precision=precision, asdecimal=asdecimal, **kw)
self.scale = scale
+
class _IntegerType(_NumericType, sqltypes.Integer):
def __init__(self, display_width=None, **kw):
self.display_width = display_width
super(_IntegerType, self).__init__(**kw)
+
class _StringType(sqltypes.String):
"""Base for MySQL string types."""
@@ -476,6 +479,7 @@ class DOUBLE(_FloatType):
super(DOUBLE, self).__init__(precision=precision, scale=scale,
asdecimal=asdecimal, **kw)
+
class REAL(_FloatType, sqltypes.REAL):
"""MySQL REAL type."""
@@ -500,6 +504,7 @@ class REAL(_FloatType, sqltypes.REAL):
super(REAL, self).__init__(precision=precision, scale=scale,
asdecimal=asdecimal, **kw)
+
class FLOAT(_FloatType, sqltypes.FLOAT):
"""MySQL FLOAT type."""
@@ -527,6 +532,7 @@ class FLOAT(_FloatType, sqltypes.FLOAT):
def bind_processor(self, dialect):
return None
+
class INTEGER(_IntegerType, sqltypes.INTEGER):
"""MySQL INTEGER type."""
@@ -547,6 +553,7 @@ class INTEGER(_IntegerType, sqltypes.INTEGER):
"""
super(INTEGER, self).__init__(display_width=display_width, **kw)
+
class BIGINT(_IntegerType, sqltypes.BIGINT):
"""MySQL BIGINTEGER type."""
@@ -567,6 +574,7 @@ class BIGINT(_IntegerType, sqltypes.BIGINT):
"""
super(BIGINT, self).__init__(display_width=display_width, **kw)
+
class MEDIUMINT(_IntegerType):
"""MySQL MEDIUMINTEGER type."""
@@ -587,6 +595,7 @@ class MEDIUMINT(_IntegerType):
"""
super(MEDIUMINT, self).__init__(display_width=display_width, **kw)
+
class TINYINT(_IntegerType):
"""MySQL TINYINT type."""
@@ -607,6 +616,7 @@ class TINYINT(_IntegerType):
"""
super(TINYINT, self).__init__(display_width=display_width, **kw)
+
class SMALLINT(_IntegerType, sqltypes.SMALLINT):
"""MySQL SMALLINTEGER type."""
@@ -627,6 +637,7 @@ class SMALLINT(_IntegerType, sqltypes.SMALLINT):
"""
super(SMALLINT, self).__init__(display_width=display_width, **kw)
+
class BIT(sqltypes.TypeEngine):
"""MySQL BIT type.
@@ -663,6 +674,7 @@ class BIT(sqltypes.TypeEngine):
return value
return process
+
class TIME(sqltypes.TIME):
"""MySQL TIME type.
@@ -710,10 +722,12 @@ class TIME(sqltypes.TIME):
return None
return process
+
class TIMESTAMP(sqltypes.TIMESTAMP):
"""MySQL TIMESTAMP type."""
__visit_name__ = 'TIMESTAMP'
+
class YEAR(sqltypes.TypeEngine):
"""MySQL YEAR type, for single byte storage of years 1901-2155."""
@@ -722,6 +736,7 @@ class YEAR(sqltypes.TypeEngine):
def __init__(self, display_width=None):
self.display_width = display_width
+
class TEXT(_StringType, sqltypes.TEXT):
"""MySQL TEXT type, for text up to 2^16 characters."""
@@ -757,6 +772,7 @@ class TEXT(_StringType, sqltypes.TEXT):
"""
super(TEXT, self).__init__(length=length, **kw)
+
class TINYTEXT(_StringType):
"""MySQL TINYTEXT type, for text up to 2^8 characters."""
@@ -788,6 +804,7 @@ class TINYTEXT(_StringType):
"""
super(TINYTEXT, self).__init__(**kwargs)
+
class MEDIUMTEXT(_StringType):
"""MySQL MEDIUMTEXT type, for text up to 2^24 characters."""
@@ -819,6 +836,7 @@ class MEDIUMTEXT(_StringType):
"""
super(MEDIUMTEXT, self).__init__(**kwargs)
+
class LONGTEXT(_StringType):
"""MySQL LONGTEXT type, for text up to 2^32 characters."""
@@ -882,6 +900,7 @@ class VARCHAR(_StringType, sqltypes.VARCHAR):
"""
super(VARCHAR, self).__init__(length=length, **kwargs)
+
class CHAR(_StringType, sqltypes.CHAR):
"""MySQL CHAR type, for fixed-length character data."""
@@ -902,6 +921,7 @@ class CHAR(_StringType, sqltypes.CHAR):
"""
super(CHAR, self).__init__(length=length, **kwargs)
+
class NVARCHAR(_StringType, sqltypes.NVARCHAR):
"""MySQL NVARCHAR type.
@@ -954,23 +974,24 @@ class NCHAR(_StringType, sqltypes.NCHAR):
super(NCHAR, self).__init__(length=length, **kwargs)
-
-
class TINYBLOB(sqltypes._Binary):
"""MySQL TINYBLOB type, for binary data up to 2^8 bytes."""
__visit_name__ = 'TINYBLOB'
+
class MEDIUMBLOB(sqltypes._Binary):
"""MySQL MEDIUMBLOB type, for binary data up to 2^24 bytes."""
__visit_name__ = 'MEDIUMBLOB'
+
class LONGBLOB(sqltypes._Binary):
"""MySQL LONGBLOB type, for binary data up to 2^32 bytes."""
__visit_name__ = 'LONGBLOB'
+
class ENUM(sqltypes.Enum, _StringType):
"""MySQL ENUM type."""
@@ -1086,6 +1107,7 @@ class ENUM(sqltypes.Enum, _StringType):
kw['strict'] = self.strict
return sqltypes.Enum.adapt(self, impltype, **kw)
+
class SET(_StringType):
"""MySQL SET type."""
@@ -1250,11 +1272,13 @@ ischema_names = {
'year': YEAR,
}
+
class MySQLExecutionContext(default.DefaultExecutionContext):
def should_autocommit_text(self, statement):
return AUTOCOMMIT_RE.match(statement)
+
class MySQLCompiler(compiler.SQLCompiler):
render_table_with_column_in_update_from = True
@@ -1569,6 +1593,7 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
(self.preparer.format_table(constraint.table),
qual, const)
+
class MySQLTypeCompiler(compiler.GenericTypeCompiler):
def _extend_numeric(self, type_, spec):
"Extend a numeric-type declaration with MySQL specific extensions."
@@ -1843,6 +1868,7 @@ class MySQLIdentifierPreparer(compiler.IdentifierPreparer):
return tuple([self.quote_identifier(i) for i in ids if i is not None])
+
class MySQLDialect(default.DefaultDialect):
"""Details of the MySQL dialect. Not used directly in application code."""
@@ -2325,6 +2351,7 @@ class MySQLDialect(default.DefaultDialect):
rp.close()
return rows
+
class ReflectedState(object):
"""Stores raw information about a SHOW CREATE TABLE statement."""
@@ -2335,6 +2362,7 @@ class ReflectedState(object):
self.keys = []
self.constraints = []
+
class MySQLTableDefinitionParser(object):
"""Parses the results of a SHOW CREATE TABLE statement."""
@@ -2790,6 +2818,7 @@ def _pr_compile(regex, cleanup=None):
return (_re_compile(regex), cleanup)
+
def _re_compile(regex):
"""Compile a string to regex, I and UNICODE."""