Skip to content

A native macOS / windows / Linux database IDE built with Swift and AppKit. Connect to PostgreSQL, MySQL, SQLite, and Redis from a single app with a fast, keyboard-driven interface.

C++

merge: resolve conflict with main (keep bg-thread LogQuery dispatch path)

DangHuynhf5218b6a3d10
diff --cc windows/Gridex/WorkspacePage.cpp
index 7e5b54c,a48649d..a8733e7
--- a/windows/Gridex/WorkspacePage.cpp
+++ b/windows/Gridex/WorkspacePage.cpp
@@@ -378,18 -378,7 +378,20 @@@ namespace winrt::Gridex::implementatio
auto result = adapter->execute(effective);
if (rewritten) result.sql = effective; // log rewritten form
- LogQuery(result);
+ // QueryEditorView now calls this lambda from a
+ // background thread (so the loading overlay can
+ // paint while adapter->execute blocks). LogQuery
+ // touches XAML, so marshal it back to the UI via
+ // the page's own dispatcher (xaml elements expose
+ // their dispatcher on every thread, GetForCurrent
+ // returns null off the UI thread).
+ auto self = get_strong();
+ auto dq = self->DispatcherQueue();
+ DBModels::QueryResult forLog = result;
+ if (dq)
+ dq.TryEnqueue([self, forLog]{ self->LogQuery(forLog); });
++ else
++ LogQuery(result);
return result;
}
catch (const std::exception& ex)