snowflakedb / snowflake-connector-net

Snowflake Connector for .NET
Apache License 2.0
180 stars 139 forks source link

SNOW-903956: Add CloseAsync() that calls CloseAsync(CancellationToken) #762

Closed aschwenker-insight closed 1 year ago

aschwenker-insight commented 1 year ago

What is the current behavior?

The Snowflake Driver (SnowflakDbConnection) has a Close() and a CloseAsync(CancellationToken) method. These methods have similar but not the same implementation. SnowflakeDbConnection extends DbConnection, which has a virtual CloseAsync() method. DbConnection's CloseAsync() method simply calls Close().

If a user has a handle to SnowflakeDbConnection as a DbConnection, they only have access to CloseAsync() and not CloseAsync(CancellationToken).

What is the desired behavior?

SnowflakeDbConnection should override CloseAsync() and have it call CloseAsync(CancellationToken.None).

How would this improve snowflake-connector-net?

Users could have a handle to DbConnection instead of SnowflakeDbConnection, which improves portability and SOLID in their code.

References, Other Background

This is fixed in PR #538

What is your Snowflake account identifier, if any?

sfc-gh-dszmolka commented 1 year ago

hello and thank you for your contribution, also opening this Issue to track why the PR is necessary! we'll take a look.

sfc-gh-pbulawa commented 1 year ago

Thank you for the contribution. Your PR has been merged.

sfc-gh-dszmolka commented 1 year ago

fix is now out with release 2.1.2