JordanMarr / SqlHydra

SqlHydra is a suite of NuGet packages for working with databases in F# including code generation tools and query expressions.
MIT License
212 stars 20 forks source link

New "Query Logging" feature doesn't capture inserts properly #68

Closed JordanMarr closed 8 months ago

JordanMarr commented 8 months ago

The new Query Logging feature logs the SqlResult at the BuildCommand method. This is fine for most of the operations except for inserts which have to apply some "fixes" post-BuildCommand.

For example. onConflictDoUpdate and getId custom operations on the InsertBuilder append to the SQL, but these changes are not reflected in the reported query output.

JordanMarr commented 8 months ago

Inserts now log the updated CommandText manually. I also had to override the QueryResult ToString to make it easier to consistently format modified insert queries.