Dzoukr / Dapper.FSharp

Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL, PostgreSQL, and SQLite
MIT License
366 stars 35 forks source link

Fix updateOutputAsync bug with updating option value to Some #3

Closed ssiltanen closed 4 years ago

ssiltanen commented 4 years ago

Issue: When using updateOutputAsync method with record with Option of value Some dapper throws an exception: Implicit conversion from data type sql_variant to is not allowed.

Reproduce: I created a test case for this: "Updates option field to Some and outputs record". In the first commit this test still fails. With the second commit the test passes.

This PR fixes this issue with the same solution already applied to the normal outputAsync method which I apparently forgot to add to this updateOutputAsync method. Sorry. To make it up, I created a bunch more tests for the project.

Created a test for this issue in both normal update and updateOutput methods as well as updating to None.

Created tests for returning multiple rows with output methods.

Created tests for returning a column subset with output methods.

To make the tests easier to manage separated output method tests from normal tests.

Sorry again for the trouble :)

Dzoukr commented 4 years ago

Hello Sampo, thanks for finding out and fixing quickly. I don't use the Output methods (yet), but it's great you did some dogfooding and found those. 👍 Going to release new version in few minutes, thanks! 👏

Dzoukr commented 4 years ago

And published as 1.4.1 - thanks again for a great contribution!