You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Arcus Observability.Telemetry.Sql project now has a dependency on the Microsoft.Data.SqlClient package.
We use this package now just so that we can use the SqlConnectionStringBuilder class. One of the LogSqlDependency methods takes a parameter that accepts a connection-string to a Sql database. We use the SqlConnectionStringBuilder to parse this connection-string and retrieve the servername and the database-name from the connection-string.
I think it is kind of bloated and unnecessary to have a dependency on this package just for this. Since a connection-string is nothing more then a string with multiple key/value pairs, I wonder if we cannot just write a simple 'parser' ourselves that retrieves the parts that we need.
I'm thinking of something really simple like this:
There are of course some edge cases, as a connection string can have a Server component, but it is also possible to have a Data Source component instead.
The Arcus Observability.Telemetry.Sql project now has a dependency on the Microsoft.Data.SqlClient package.
We use this package now just so that we can use the
SqlConnectionStringBuilder
class. One of theLogSqlDependency
methods takes a parameter that accepts a connection-string to a Sql database. We use theSqlConnectionStringBuilder
to parse this connection-string and retrieve the servername and the database-name from the connection-string.I think it is kind of bloated and unnecessary to have a dependency on this package just for this. Since a connection-string is nothing more then a string with multiple key/value pairs, I wonder if we cannot just write a simple 'parser' ourselves that retrieves the parts that we need.
I'm thinking of something really simple like this:
There are of course some edge cases, as a connection string can have a
Server
component, but it is also possible to have aData Source
component instead.See also the comments in this PR: #485
The text was updated successfully, but these errors were encountered: