sdrapkin / SecurityDriven.TinyORM

.NET micro ORM done right.
Microsoft Public License
305 stars 20 forks source link

Any plans on changing connections to use Microsoft.Data.SqlClient? #12

Open dsmeltz opened 3 years ago

dsmeltz commented 3 years ago

There are some interesting features concerning Active Directory that Microsoft.Data.SqlClient brings with it. My particular scenario is creating a connection string with the newer Authentication keyword. This is used to support Active Directory Integrated, Active Directory Password and Sql Password authentication schemes.

I'm working on a .Net 5 Core project.

sdrapkin commented 3 years ago

I've been watching Microsoft.Data.SqlClient (MDS) project for a while. Some concerns/questions it raises:

One approach is to wait for MDS to become mature enough to rebase to MDM entirely and never look back. However there are still many perfectly valid users and usecases committed to .NET 4.x which will need to be supported forever with SDS. Using MDS is not a guarantee that SDS will not appear as a dependency in some 3rd-party component. The key purpose of SqlClient is that there is only one SqlClient, which can do ex. connection-pooling. .NET cannot drop SDS namespaces, so having both SDS and MDS would fragment connection-pools. The bold move for MS would have been to merge MDS into SDS and break APIs for latest versions of .NET. However that didn't happen. Making an explicit MDS dependency is also weird when the majority of usecases are content with SDS functionality and merely want a quick "Hello World" example to run. SDS rarely changes, rarely has serious bugs, and is unlikely to break TinyORM, which cannot be said about MDS.

dsmeltz commented 3 years ago

Is there any way that the SqlClient could be overridden by the caller? Possibly via IDbConnection? That way the caller could just use the SDS by default or use provide a client of their own choosing.

sdrapkin commented 3 years ago

I have a few not-very-strong arguments against IDb* changes:

APIs are always the hardest thing to get right (not claiming I did). Especially as time goes by and platforms evolve.