To me this is still a bit too jagged of an edge. Probably the way around having to call something at app startup is to include the initialization as a let statement in the Sql module. But I am not sure if it would get optimized away in a production build, since it will never get referenced.
One other gotcha: The column order in the returned query data must match the property order on F# records. Maybe this is because of the way the F# record constructor is generated, but Dapper cannot figure it out if the returned data is in a different order.
I will setup a github repo for it tonight, time permitting. I can include multi queries too (i.e. SELECT ... ; SELECT ... ;).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here is what I use to setup the optional type handlers. After that
string option
and many other optional types are handled automatically.Then as part of app startup, I call:
To me this is still a bit too jagged of an edge. Probably the way around having to call something at app startup is to include the initialization as a
let
statement in the Sql module. But I am not sure if it would get optimized away in a production build, since it will never get referenced.One other gotcha: The column order in the returned query data must match the property order on F# records. Maybe this is because of the way the F# record constructor is generated, but Dapper cannot figure it out if the returned data is in a different order.
I will setup a github repo for it tonight, time permitting. I can include multi queries too (i.e.
SELECT ... ; SELECT ... ;
).