zillow / ctds

Python DB-API 2.0 library for MS SQL Server
MIT License
83 stars 12 forks source link

Connect function slightly differs from pymssql #5

Closed npezolano closed 7 years ago

npezolano commented 7 years ago

This is just to make ctds an easier drop in replacement for pymssql. Pymssql allows you to pass the keyword host or server to the connect function, currently ctds only uses the keyword server. Would be nice if you can pass host as well.

https://github.com/zillow/ctds/blob/master/ctds/tds.c#L162 https://github.com/pymssql/pymssql/blob/master/src/pymssql.pyx#L632-L633

joshuahlang commented 7 years ago

The parameter names were chosen to be compatible to some extent. Of course, as_dict is not supported since ctds supports both tuple and dict access to rows. The choice to allow an undocumented host parameter that is essentially just an alias for the server parameter seems strange to me. I'd guess it was for compatibility with something else? Regardless, I'd like to keep the interface as clean and as simple as possible.

Is this such a large barrier to adoption?

npezolano commented 7 years ago

This makes life easier for porting over a large project but it's definitely not needed, I made it because it should be your call.

joshuahlang commented 7 years ago

I don't think this should be added. I'd prefer not to perpetuate what seems like a questionable choice to alias a function parameter made in other libraries.