summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/base.py
diff options
context:
space:
mode:
authorGaëtan de Menten <gdementen@gmail.com>2010-02-13 22:53:39 +0000
committerGaëtan de Menten <gdementen@gmail.com>2010-02-13 22:53:39 +0000
commit165609a190665f5453417c9c935a834714c7f5a5 (patch)
tree90d3d0da3f233cf6fc211f367eea0dba661b098e /lib/sqlalchemy/dialects/mysql/base.py
parentf2974ef3993e02646a2dfade5feb74afb78f370f (diff)
downloadsqlalchemy-165609a190665f5453417c9c935a834714c7f5a5.tar.gz
- Added an optional C extension to speed up the sql layer by
reimplementing the highest impact functions. The actual speedups will depend heavily on your DBAPI and the mix of datatypes used in your tables, and can vary from a 50% improvement to more than 200%. It also provides a modest (~20%) indirect improvement to ORM speed for large queries. Note that it is *not* built/installed by default. See README for installation instructions. - The most common result processors conversion function were moved to the new "processors" module. Dialect authors are encouraged to use those functions whenever they correspond to their needs instead of implementing custom ones.
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/base.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py
index eb348f1a1..82a4af941 100644
--- a/lib/sqlalchemy/dialects/mysql/base.py
+++ b/lib/sqlalchemy/dialects/mysql/base.py
@@ -351,7 +351,8 @@ class DECIMAL(_NumericType, sqltypes.DECIMAL):
numeric.
"""
- super(DECIMAL, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw)
+ super(DECIMAL, self).__init__(precision=precision, scale=scale,
+ asdecimal=asdecimal, **kw)
class DOUBLE(_FloatType):
@@ -375,7 +376,8 @@ class DOUBLE(_FloatType):
numeric.
"""
- super(DOUBLE, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw)
+ super(DOUBLE, self).__init__(precision=precision, scale=scale,
+ asdecimal=asdecimal, **kw)
class REAL(_FloatType):
"""MySQL REAL type."""
@@ -398,7 +400,8 @@ class REAL(_FloatType):
numeric.
"""
- super(REAL, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw)
+ super(REAL, self).__init__(precision=precision, scale=scale,
+ asdecimal=asdecimal, **kw)
class FLOAT(_FloatType, sqltypes.FLOAT):
"""MySQL FLOAT type."""
@@ -421,7 +424,8 @@ class FLOAT(_FloatType, sqltypes.FLOAT):
numeric.
"""
- super(FLOAT, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw)
+ super(FLOAT, self).__init__(precision=precision, scale=scale,
+ asdecimal=asdecimal, **kw)
def bind_processor(self, dialect):
return None
@@ -2459,6 +2463,7 @@ class _DecodingRowProxy(object):
def __init__(self, rowproxy, charset):
self.rowproxy = rowproxy
self.charset = charset
+
def __getitem__(self, index):
item = self.rowproxy[index]
if isinstance(item, _array):
@@ -2467,6 +2472,7 @@ class _DecodingRowProxy(object):
return item.decode(self.charset)
else:
return item
+
def __getattr__(self, attr):
item = getattr(self.rowproxy, attr)
if isinstance(item, _array):