Re: [sqlalchemy] MSSQL String columns often incorrectly encoded as NVARCHAR

2019-03-31 Thread Ian Wagner
Thanks. I’ll pursue those avenues. Cheers, Ian 2019년 4월 1일 (월) 11:30, Mike Bayer 님이 작성: > On Sun, Mar 31, 2019 at 10:12 PM Ian Wagner > wrote: > > > > > > My suggestion would be a pymssql dialect-level patch to send bytestrings > for String columns, and of course continue passing str/unicode

Re: [sqlalchemy] MSSQL String columns often incorrectly encoded as NVARCHAR

2019-03-31 Thread Mike Bayer
On Sun, Mar 31, 2019 at 10:12 PM Ian Wagner wrote: > > > My suggestion would be a pymssql dialect-level patch to send bytestrings for > String columns, and of course continue passing str/unicode for Unicode > columns. I'm on the mailing list looking for help with why my solution > doesn't work

Re: [sqlalchemy] MSSQL String columns often incorrectly encoded as NVARCHAR

2019-03-31 Thread Ian Wagner
Thanks for the reply, Mike! the NVARCHAR thing should not happen if you are comparing to a > non-NVARCHAR column. it only occurs when there is no other context > that SQLAlchemy can determine the correct datatype for the Unicode > object being passed. This was my impression as well. I am,

Re: [sqlalchemy] MSSQL String columns often incorrectly encoded as NVARCHAR

2019-03-29 Thread Mike Bayer
Also note pymssql is not well maintained right now due to lack of funding, please confirm you reproduce your performance concerns using PyODBC with Microsofts ODBC drivers ? That should be considered to be the canonically supported driver right now, works on all platforms very well now. On Fri,

Re: [sqlalchemy] MSSQL String columns often incorrectly encoded as NVARCHAR

2019-03-29 Thread Mike Bayer
OK so I saw that the "N" prefix is not generated with your test case either, so I re-read your email. Can you clarify what you mean by "always encoded as NVARCHAR"? are you referring to the simple fact that a Python string object is passed to the driver, and that the driver is behind the scenes

Re: [sqlalchemy] MSSQL String columns often incorrectly encoded as NVARCHAR

2019-03-29 Thread Mike Bayer
On Fri, Mar 29, 2019 at 6:20 AM Ian Wagner wrote: > > Hello all, > > I'm trying to get to the bottom of an issue in which Python 3 (unicode by > definition) strings are always encoded as NVARCHAR for at least two backends > (pymssql and pyodbc). Using bytstrings as comparison arguments (for

[sqlalchemy] MSSQL String columns often incorrectly encoded as NVARCHAR

2019-03-29 Thread Ian Wagner
Hello all, I'm trying to get to the bottom of an issue in which Python 3 (unicode by definition) strings are always encoded as NVARCHAR for at least two backends (pymssql and pyodbc). Using bytstrings as comparison arguments (for example Table.column == value.encode('utf-8')) sends a regular