Conversation
…Match by Name and Match by Position
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This was referenced Sep 29, 2026
Merged
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
…the mapping UI test
datlechin
added this pull request to stack #3209
September 29, 2026 20:15
…enu in the row import UI test
…d-column-mapping # Conflicts: # CHANGELOG.md
datlechin
removed this pull request from stack #3209
September 30, 2026 10:12
datlechin
added this pull request to stack #3221
September 30, 2026 10:14
datlechin
removed this pull request from stack #3221
September 30, 2026 10:15
… one destination column (#3187) * fix(plugins): refuse a table transfer that maps two source columns to one destination column * fix(plugins): keep a skipped import field out of the column its case twin maps to * refactor(plugins): pass the import source fields as a set
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
This was referenced Sep 30, 2026
fix(connections): MongoDB restore into a renamed database restores nothing and reports success
#3222
Open
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Row imports (CSV, JSON, Excel) now remember the field-to-column choices made for each table. The mapping sheet also gets a Match Columns pull-down with Match by Name, Match by Position and Use Saved Mapping. When saved choices are applied, the sheet says so: "Restored the mapping saved for table."
Fixes #3172
Root cause
RowImportSheetkept the mapping in view@Stateonly.loadExistingContextrebuilt it from a case-insensitive name match every time a table was picked or the file was read again. So a header likeE-mailfor anemailcolumn had to be mapped by hand on every import, and there was no way to map by position.Design
ImportColumnMatcheris a pure type that resolves the mapping in tiers:The name rule deliberately differs from
TableColumnMatcher(Table Transfer), which is left as it is.ImportColumnMappingStoreis aTableScopedSettingsStoremodelled onForeignKeyLabelColumnStore: UserDefaults, stored only on this Mac, no CloudKit.columnorskip. An automatic "no match" is never frozen, so a column added to the table later is still found by name.TableScopedSettingsRegistry, so a sidebar rename or drop, or deleting the connection, carries the mapping along or forgets it.Saved when Import starts, whether the import then succeeds or fails. It is saved from the same plan the import runs, not from what the rows show. A new table saves only the columns that were renamed or left out.
RowImportMapping: the sheet's mapping state moved into a@MainActor ObservableObject(theCreateTableDraftshape). That makes the rules unit-testable and keepsRowImportSheetunder the type-body limit.Reads of the file now go through one
.task(id:)keyed on destination, database scope, table, detection options and a per-destination retry count.Match by Position is offered only when the plugin says its fields follow the file's order.
JSONSerializationdrops key order. That includes the.jsonlsnapshot the Data Files window hands over.ImportFormatPlugin.sourceFieldsFollowFileOrder. It defaults tofalse; CSV and XLSX returntrue.ImportFieldNaming.uniqueNamesis also new in PluginKit. CSV and XLSX now name their header fields with it.scripts/check-pluginkit-abi.shshows only additions.currentPluginKitVersiongoes from 33 to 34 (the first bump since v0.76.1), along with every pluginInfo.plist;minimumCompatiblePluginKitVersionis unchanged.Defects fixed on the way
The new commands and the one-field-per-column rule hit each of these directly:
PluginManager, so the re-read ran late, usually right after the user's next manual pick, and then threw that pick away.Emailandemail. The sink folded field names, so the field the user skipped was imported onto its twin's column and every INSERT named that column twice. The sink now matches the exact name first. It folds case only for a field the sheet never listed, and only when that spelling points at a single listed field, a single mapping key and a single field of the row.Notescolumn overwrote the first. In both formats, a blank header's placeholder could take a name a later header spelled out, so the import read the wrong column under that name.Reviews
review,adversarial-reviewand a secondreview. The second one found one more case-folding path, now fixed.Before / After
Not captured yet. The change adds a row above the mapping list: the "Restored the mapping saved for …" caption on the left and a Match Columns pull-down on the right. Screenshots need a driven Debug build, and during this session the Mac was first locked and then in use. A SwiftUI
Menualso takes no synthetic click, so the open pull-down needs XCUITest or a hand capture. To do before merge.Tests
ImportColumnMatcherTests(23),ImportColumnMappingStoreTests(8),RowImportMappingTests(14),ImportDataSinkAdapterMappingTests(13),XLSXSheetParserTests(12),CSVImportPluginTests(24)SQLServerImportBatchTests,TableScopedSettingsRegistryTests,PreferenceKeysGuardTests,PluginKitABIResilienceTests,PluginSignatureSweepTests,TransferAlertWindowOwnershipTests,ValueDisplayFormatStorageTests,AppSettingsStorageResetTestsAllPlugins(all 41) and the ABI check all pass locally.RowImportMappingMemoryUITestsimports a CSV withGenreId,Titleinto the sample database'sGenretable and mapsTitletoNameby hand. It then opens the sheet again and checks thatTitlecomes back onNamewith the restored caption. It has not run locally: the first attempt timed out enabling UI automation while the Mac was locked, and afterwards the machine was in use. CI's UI job is its first run.Not in this PR (found while investigating)
createdTablesby bare table name. If the browse database changes while the sheet is open, a retry can clear rows from a same-named table in the other database. Pre-existing.DROP TABLErun in the SQL editor does not clear any table-scoped settings (filters, value formats, FK labels, and now import mappings). Only a sidebar drop does. Pre-existing; the docs say so.CI fixes
The failed package test was
SyncRecordMapperTests.unknownWireValueFailsClosed. The mapper's duplicate Safe Mode decoder turned unknown values into Off. It now uses the model'sSafeModeLevel(wireValue:isReadOnly:)policy. Added regressions for unknown values on read-only connections and renames that preserve unknown wire values.SurrealDB's JSON helper had become a property while its callers still supplied the requested text length. Restored the length-taking helper, keeping valid display truncation and complete export text.
Integrated main through
3cf419ce1, keeping both sets of changelog entries. The storage conflicts retain both preference key families and register bothImportColumnMappingStoreandTableFolderStorage, so rename, drop and connection deletion reach both.Verification for these fixes:
TableProApp/rust-dameng,Contents/MacOS,Contents/Helpers,/Applications/Xcode-beta.app).PreferenceKeysGuardTests,TableScopedSettingsRegistryTests,ImportColumnMappingStoreTests,TableFolderStorageTests,AppSettingsStorageResetTests,TypesenseStatementGeneratorTests, andElasticsearchStatementGeneratorTests.Pushing these commits triggers fresh GitHub Actions runs.
Unit-test compile correction
The unit-test build exposed three fixtures still calling the old one-argument cell API: two in Typesense and one in Elasticsearch. They now explicitly pass
length: .display, retaining their expected display truncation and write-refusal behavior.Both fixture files are identical on all four updated branches. The complete test target built on #3183, with all 87 selected storage and write-refusal tests passing. Separately, an isolated SwiftPM build of all Elasticsearch and Typesense driver sources and the actual driver test files passed 175 tests in 14 suites on this branch. SwiftLint found no violations in the two fixture files.