sqlkata / querybuilder

SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
https://sqlkata.com
MIT License
3.09k stars 499 forks source link

Use RetryProvider in SqlKata.Execution #718

Open Genmutant opened 5 months ago

Genmutant commented 5 months ago

I'm trying to use a RetryProvider with the SqlKata.Execution package.

Which works for the RetryProvider on the connection, as I can just set it before passing the connection to a new QueryFactory object. I can't find a way to pass it to the internally created Command object though. My current workaround is implementing my own IDbConnection object and passing the methods to the underlying SqlConnection. CreateCommand I set the RetryProvider before returning the new command.

This is not a great solution, as Dapper internally has different paths for SqlConnection and IDbConnection - for example I have to pass an open IDbConnection, while with SqlConnection it can handle open and closing itself.

Are there any nicer solutions I overlooked, or are there plans to support RetryProviders?