diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-02-04 16:44:00 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-02-04 16:44:00 +0000 |
commit | e416129179d58879ac1d3facc48a4c640e78c05d (patch) | |
tree | 5888c2c5a850d6b1abfff98def7ce97279a3ca62 /lib/sqlalchemy/databases/mysql.py | |
parent | 0324af702aeaf28ba5a07b5707f19a189d75f47f (diff) | |
download | sqlalchemy-e416129179d58879ac1d3facc48a4c640e78c05d.tar.gz |
Rick Morrison's patch adding Smallint, Date, and Time support !
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index fda41a3fc..268639b69 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -28,9 +28,18 @@ class MSFloat(sqltypes.Float): class MSInteger(sqltypes.Integer): def get_col_spec(self): return "INTEGER" +class MSSmallInteger(sqltypes.Smallinteger): + def get_col_spec(self): + return "SMALLINT" class MSDateTime(sqltypes.DateTime): def get_col_spec(self): return "DATETIME" +class MSDate(sqltypes.Date): + def get_col_spec(self): + return "DATE" +class MSTime(sqltypes.Time): + def get_col_spec(self): + return "TIME" class MSText(sqltypes.TEXT): def get_col_spec(self): return "TEXT" @@ -54,9 +63,12 @@ class MSBoolean(sqltypes.Boolean): colspecs = { sqltypes.Integer : MSInteger, + sqltypes.Smallinteger : MSSmallInteger, sqltypes.Numeric : MSNumeric, sqltypes.Float : MSFloat, sqltypes.DateTime : MSDateTime, + sqltypes.Date : MSDate, + sqltypes.Time : MSTime, sqltypes.String : MSString, sqltypes.Binary : MSBinary, sqltypes.Boolean : MSBoolean, @@ -66,6 +78,7 @@ colspecs = { ischema_names = { 'int' : MSInteger, + 'smallint' : MSSmallInteger, 'varchar' : MSString, 'char' : MSChar, 'text' : MSText, @@ -73,6 +86,8 @@ ischema_names = { 'float' : MSFloat, 'timestamp' : MSDateTime, 'datetime' : MSDateTime, + 'date' : MSDate, + 'time' : MSTime, 'binary' : MSBinary, 'blob' : MSBinary, } |