diff options
author | Paul Johnston <paj@pajhome.org.uk> | 2007-08-17 16:44:33 +0000 |
---|---|---|
committer | Paul Johnston <paj@pajhome.org.uk> | 2007-08-17 16:44:33 +0000 |
commit | 3469724a42acff29c8e064b3cfaf8d073790624b (patch) | |
tree | 799544e6bd5d80d54407ecbf0518e144c705170f /lib/sqlalchemy/databases/mssql.py | |
parent | c23f82d98984da5b8ead218787700657ca6999e5 (diff) | |
download | sqlalchemy-3469724a42acff29c8e064b3cfaf8d073790624b.tar.gz |
Merge [3345] into trunk. Unit test still TODO
Diffstat (limited to 'lib/sqlalchemy/databases/mssql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mssql.py | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py index bef3eb541..25238c697 100644 --- a/lib/sqlalchemy/databases/mssql.py +++ b/lib/sqlalchemy/databases/mssql.py @@ -32,8 +32,6 @@ Known issues / TODO: * No support for more than one ``IDENTITY`` column per table -* No support for ``GUID`` type columns (yet) - * pymssql has problems with binary and unicode data that this module does **not** work around @@ -81,11 +79,15 @@ class MSInteger(sqltypes.Integer): def get_col_spec(self): return "INTEGER" -class MSTinyInteger(sqltypes.Integer): +class MSBigInteger(MSInteger): + def get_col_spec(self): + return "BIGINT" + +class MSTinyInteger(MSInteger): def get_col_spec(self): return "TINYINT" -class MSSmallInteger(sqltypes.Smallinteger): +class MSSmallInteger(MSInteger): def get_col_spec(self): return "SMALLINT" @@ -244,6 +246,22 @@ class MSTimeStamp(sqltypes.TIMESTAMP): def get_col_spec(self): return "TIMESTAMP" +class MSMoney(sqltypes.TypeEngine): + def get_col_spec(self): + return "MONEY" + +class MSSmallMoney(MSMoney): + def get_col_spec(self): + return "SMALLMONEY" + +class MSUniqueIdentifier(sqltypes.TypeEngine): + def get_col_spec(self): + return "UNIQUEIDENTIFIER" + +class MSVariant(sqltypes.TypeEngine): + def get_col_spec(self): + return "SQL_VARIANT" + def descriptor(): return {'name':'mssql', 'description':'MSSQL', @@ -369,6 +387,7 @@ class MSSQLDialect(ansisql.ANSIDialect): ischema_names = { 'int' : MSInteger, + 'bigint': MSBigInteger, 'smallint' : MSSmallInteger, 'tinyint' : MSTinyInteger, 'varchar' : MSString, @@ -383,10 +402,15 @@ class MSSQLDialect(ansisql.ANSIDialect): 'datetime' : MSDateTime, 'smalldatetime' : MSDate, 'binary' : MSBinary, + 'varbinary' : MSBinary, 'bit': MSBoolean, 'real' : MSFloat, 'image' : MSBinary, 'timestamp': MSTimeStamp, + 'money': MSMoney, + 'smallmoney': MSSmallMoney, + 'uniqueidentifier': MSUniqueIdentifier, + 'sql_variant': MSVariant, } def __new__(cls, dbapi=None, *args, **kwargs): |