On Nov 21, 2012, at 4:42 PM, Ivan Kalinin wrote:
Hellow, fellow developers!
I have run into and issue trying to use SQLAlchemy (0.7.4) and recent pymssql
(2.0.0).
Precisely, pymssql can not handle uuid.UUID objects as parameters (see
related post on their ML here), but SA uses them
Thanks for the reply!
However, I see that MSSQL dialect contains a UNIQUEIDENTIFIER type that is
to represent similarly named column type. Looks like it should handle
issues of marshalling the values, not some custom type.
On Friday, November 23, 2012 7:39:50 PM UTC+4, Michael Bayer wrote:
In my own MSSQL work, we use character fields for UUIDs as the DBAs were not in
favor of trying to get UNIQUEIDENTIFIER to work. However, feel free to use
UserDefinedType to implement UNIQUEIDENTIFIER including whatever coercion
pymssql requires
Wait. I mean that SA _already_ has implemented UNIQUEIDENTIFIER over here:
https://bitbucket.org/sqlalchemy/sqlalchemy/src/0c8e0b613da3b2bf6e965e1e5c15b6b3e540368a/lib/sqlalchemy/dialects/mssql/base.py?at=default#cl-478
I believe that thing should be responsible for valid
marshalling/unmarshalling
ideally pymssql would know how (and are you saying that pyodbc does already?),
but sure, SQLA does all kinds of coercion. For now, your options are to use
the TypeDecorator recipe mentioned earlier around this UNIQUEIDENTIFIER type,
or send me a pull request with a pymssql-specific type
Wow, thanks! But that looks pretty complex. I believe a more valid way of
fixing the issue is a patch for pymssql itself - since it's relatively
simple and already available:
https://bitbucket.org/PuPSSMaN/pymssql/changeset/ed48708effdb481a9695e58876e223eb
I'll try to contact pymssql mantainer to
Hellow, fellow developers!
I have run into and issue trying to use SQLAlchemy (0.7.4) and recent
pymssql (2.0.0).
Precisely, pymssql can not handle uuid.UUID objects as parameters (see
related post on their ML
herehttps://groups.google.com/forum/?fromgroups=#!topic/pymssql/ah6f8cl2Va0),
but