- changed status to resolved
MSMediumInt
Issue #1146
resolved
the parade of random MySQL types never ends, here's MSMediumInt:
dex: lib/sqlalchemy/databases/mysql.py
===================================================================
--- lib/sqlalchemy/databases/mysql.py (revision 5048)
+++ lib/sqlalchemy/databases/mysql.py (working copy)
@@ -172,7 +172,7 @@
'MSMediumBlob', 'MSMediumText', 'MSNChar', 'MSNVarChar',
'MSNumeric', 'MSSet', 'MSSmallInteger', 'MSString', 'MSText',
'MSTime', 'MSTimeStamp', 'MSTinyBlob', 'MSTinyInteger',
- 'MSTinyText', 'MSVarBinary', 'MSYear' )
+ 'MSTinyText', 'MSVarBinary', 'MSYear', 'MSMediumInteger' )
RESERVED_WORDS = util.Set(
@@ -549,6 +549,33 @@
return self._extend("BIGINT")
+class MSMediumInteger(MSInteger):
+ """MySQL MEDIUMINTEGER type."""
+
+ def __init__(self, length=None, **kw):
+ """Construct a MEDIUMINTEGER
+
+ length
+ Optional, maximum display width for this number.
+
+ unsigned
+ Optional.
+
+ zerofill
+ Optional. If true, values will be stored as strings left-padded with
+ zeros. Note that this does not effect the values returned by the
+ underlying database API, which continue to be numeric.
+ """
+
+ super(MSMediumInteger, self).__init__(length, **kw)
+
+ def get_col_spec(self):
+ if self.length is not None:
+ return self._extend("MEDIUMINT(%(length)s)" % {'length': self.length})
+ else:
+ return self._extend("MEDIUMINT")
+
+
class MSTinyInteger(MSInteger):
"""MySQL TINYINT type."""
the feature is requested for 0.4 and 0.5.
Comments (2)
-
reporter -
reporter - removed milestone
Removing milestone: 0.4.xx (automated comment)
- Log in to comment
ae573e047a696c3c80d11e56466c9f55b72e0461 32ada5fd98d8545586a95f36efa421629cd36020