Skip to content

feat(windows): import from other apps and edit query results - #4320

Open
datlechin wants to merge 9 commits into
mainfrom
feat/windows-ffi-import-result-edit
Open

datlechin wants to merge 9 commits into
mainfrom
feat/windows-ffi-import-result-edit

Conversation

@datlechin

@datlechin datlechin commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Core: ForeignHost::data_protection; DataGrip's CRYPT_32 KeePass main key opens through it, then as BUILT_IN.
  • FFI: Core::foreign_sources and Core::read_foreign give a ForeignImportReview (rows, notes, choices, resolve, apply once under the library write lock, passwords into the core's secret store, saved queries into the history store). Windows host passes DPAPI CryptUnprotectData.
  • FFI: DatabaseSession::result_editor(sql, rows) gives a TableEditor over a query result, one column per result column, locked with an EditLock reason (NotOneSelect, MoreThanOneTable, Collapsed, Untraced, KeyNotShown, ...). Edits name rows of that one result set only. TableEditor::table() and copies_exactly(rows, row), so a row read as PostgreSQL server text for a float, a time or money is not duplicated.
  • Interop: TableProCore.GetForeignSourcesAsync / ReadForeignAsync, ForeignImportReview, DatabaseSession.OpenResultEditorAsync, TableEditor.Table, regenerated bindings.
  • Windows: Import from another app... on the Connections page (Import button, empty-state card) and the File menu: app list, passwords and saved query options, review with checks, resolutions and notes, Navicat .ncx via the open picker.
  • Windows: a query result that is one keyed table's rows edits as a table tab's page (cells, Set value, add, duplicate, delete, Preview SQL, Save with Safe Mode, Discard); refused with its reason for several results, an open or unknown transaction, another database, or a core lock. Save runs the statement again, re-applying a held sort; an unknown outcome stays blocked until rows are read again. Menus route to the query tab. Per-cell editing moved from TableTab into EditedRows, shared by both tabs.
  • Docs: core ADR 0032 (amends 0008, 0019), Windows ADR 0014 (amends 0006), windows/AGENTS.md.
  • Roadmap: C-16, W-07, C-21, W-29. Not done: DBX passwords, which need the core to read DBX's own key scheme on every platform (ADR 0032, Consequences).

Screenshots

New surfaces, from the Windows (x64) UI tests; before this change neither the dialog nor the result's edit commands existed.

Light Dark
Import review, light Import review, dark
Import done, light Import done, dark
Query result with a pending edit, light Query result with a pending edit, dark

Test plan

  • core/crates/ffi/tests/result_edits.rs: a keyed result saves an update, insert and delete; a repeated column stays out of every statement; each lock; rows of another set, the same SQL run again included, refuse; a sorted view of the result saves.
  • core/crates/ffi/tests/foreign_import.rs: a DBeaver connection lands once with its password and script; a second read matches and keeps the saved one; an outdated library refuses; missing apps fail with their codes.
  • foreign-import unit tests: a CRYPT_32 key opens through data protection, another user's blob stops, a legacy pdb.pwd on Windows opens. Windows-only DPAPI round trip in foreign_import.rs.
  • Interop: ResultEditTests, ForeignImportTests against real SQLite and DBeaver files.
  • App.Model: QueryTabEditingTests (refusals, save and re-read, held sort, close paths, copies), ForeignImportFormTests; the existing TableTab* tests pass unchanged (731 pass).
  • UI tests: ResultEditingTests (edit, save, re-run; grouped result says why), ImportFromAppTests (Navicat export into the library), with screenshots from CI.
  • verify.sh: build, core (ffi 279, foreign-import 501), bindings, Interop and App.Model tests pass on macOS; cargo xwin clippy for x86_64-pc-windows-msvc is clean.
  • linux / Supply chain fails on RUSTSEC-2026-0543 (chrono unmaintained), a new advisory that is not this change's.

Part of #4275: WN-08. WN-09 (completion) stays open.

@datlechin
datlechin enabled auto-merge (squash) November 18, 2026 08:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant