fsprojects / SQLProvider

A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.
https://fsprojects.github.io/SQLProvider
Other
564 stars 144 forks source link

SubmitUpdates ordering #797

Closed gbtb closed 11 months ago

gbtb commented 12 months ago

Example of one possible way to fix #758

Thorium commented 11 months ago

I think we want sort to SqlRuntime.DataContext.fs here too:

member __.GetPendingEntities() = pendingChanges.Keys |> Seq.toList

That is only used for possibly manually asking changes: dbContext.GetUpdates(). Most cases would be e.g. logging or debugging: should you do SubmitUpdates() or ClearUpdates() next.

gbtb commented 11 months ago

I think it's ready for review. I would throw in couple of tests for a good measure, but I can't build tests projects no matter what I try. It struggles to find SQLite interop dlls, probably because of some weird linux+mono+472 interaction. Nevertheless, I've tested it locally with my project and with changes for proper UPSERT in SQLite I'd say it works correctly.

Thorium commented 11 months ago

Thanks. Released in NuGet package 1.3.11