querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

Use RetryProvider in SqlKata.Execution

Open Genmutant opened this issue 2 months ago • 0 comments

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?

Genmutant avatar May 01 '24 10:05 Genmutant