Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- SAP HANA database driver plugin. (#1966)
- Column mappings remembered per table for CSV, JSON and Excel imports, plus Match by Name and Match by Position. (#3172)
- Folders for tables and views in the sidebar. (#3167)
- Shift JIS, EUC-JP, GB 18030, Big5, EUC-KR and UTF-16 options for CSV and SQL import.

Expand All @@ -26,6 +27,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Explain Analyze running write statements on Read-Only connections and skipping the Alert and Safe Mode confirmation.
- Remote deletions of connections, groups, tags, SSH profiles and table favorites applied with their sync category off.
- **Local only** connections taking edits and deletions made on another device.
- Import sheet ignoring a CSV or Excel option change until the next edit, then resetting the column mapping.
- Import sheet showing an earlier table's columns after switching tables while the first was still loading.
- CSV and JSON imports failing on every row, or writing a skipped field, when two fields differ only by case.
- CSV and Excel imports reading a column under the wrong header when headers repeat or a blank one comes first.
- Import sheet's Try Again for an existing table discarding the column edits made for a new table.
- Export dialog offering a SQL row scope on MongoDB, Redis and other engines without SQL.
- CSV, XLSX and MQL exports ignoring a table's row filter, row limit and column choice.
- MQL export rounding 64-bit integers past 2^53 and restoring whole doubles and small 64-bit integers as 32-bit ones.
Expand Down Expand Up @@ -58,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `EXPLAIN ANALYSE` treated as a plain `EXPLAIN` that does not run its statement.
- Safe Mode level lost when importing a connection file from Mac to iOS or from iOS to Mac.
- Undo and Redo in a tab with unsaved edits replaying another tab's changes against the wrong rows.
- Table Transfer emptying a destination table, then failing, when two source columns map to one column.
- MongoDB, Elasticsearch, Typesense and SurrealDB saving a long array or object shortened for display as the cut text.
- MongoDB refusing text like `[DRAFT] Chapter one...` as a value shortened for display.
- Clipboard URL banner turning `sslmode=verify-full` or `verify-ca` into Required and ignoring `sslmode=disable`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,25 @@ struct SyncRecordMapperTests {
let decoded = try #require(SyncRecordMapper.toConnection(record))
#expect(decoded.safeModeLevel == .confirmWrites)
}

@Test("An unrecognized wire value keeps the legacy read-only restriction")
func unknownWireValuePreservesReadOnly() throws {
let record = makeRawRecord(safeModeLevelRaw: "someFutureLevel", isReadOnly: true)
let decoded = try #require(SyncRecordMapper.toConnection(record))
#expect(decoded.safeModeLevel == .readOnly)
}

@Test("A rename preserves an unrecognized wire value and requires confirmation")
func renamePreservesUnknownWireValue() throws {
let record = makeRawRecord(safeModeLevelRaw: "someFutureLevel")
var connection = try #require(SyncRecordMapper.toConnection(record))
connection.name = "Renamed"

SyncRecordMapper.updateRecord(record, with: connection)

#expect(record["safeModeLevel"] as? String == "someFutureLevel")
let decoded = try #require(SyncRecordMapper.toConnection(record))
#expect(decoded.name == "Renamed")
#expect(decoded.safeModeLevel == .confirmWrites)
}
}
2 changes: 1 addition & 1 deletion Plugins/BeancountDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>Beancount</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/BigQueryDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>TableProMinAppVersion</key>
<string>0.42.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/CSVExportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesExportFormatIds</key>
<array>
<string>csv</string>
Expand Down
18 changes: 3 additions & 15 deletions Plugins/CSVImportPlugin/CSVImportParsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,10 @@ enum CSVImportParsing {
}

static func columnNames(header: [String]?, columnCount: Int) -> [String] {
var names: [String] = []
names.reserveCapacity(columnCount)
var used = Set<String>()
for index in 0..<columnCount {
let raw = header.flatMap { index < $0.count ? $0[index] : nil } ?? ""
let trimmed = raw.trimmingCharacters(in: .whitespacesAndNewlines)
let base = trimmed.isEmpty ? defaultColumnName(index) : trimmed
var unique = base
var suffix = 2
while !used.insert(unique).inserted {
unique = "\(base) \(suffix)"
suffix += 1
}
names.append(unique)
let cells = (0..<columnCount).map { index in
header.flatMap { index < $0.count ? $0[index] : nil }
}
return names
return ImportFieldNaming.uniqueNames(for: cells, placeholder: defaultColumnName)
}

static func cellValue(from raw: String, options: CSVImportOptions) -> PluginCellValue {
Expand Down
1 change: 1 addition & 0 deletions Plugins/CSVImportPlugin/CSVImportPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ final class CSVImportPlugin: ObservableObject, ImportFormatPlugin, SettablePlugi
static let acceptedFileExtensions = ["csv", "tsv"]
static let iconName = "tablecells"
static let requiresTargetTable = true
static let sourceFieldsFollowFileOrder = true

typealias Settings = CSVImportOptions
static let settingsStorageId = "csv-import"
Expand Down
2 changes: 1 addition & 1 deletion Plugins/CSVImportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesImportFormatIds</key>
<array>
<string>csv</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/CassandraDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>NSPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).CassandraPlugin</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/ClickHouseDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>ClickHouse</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/CloudflareD1DriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>TableProMinAppVersion</key>
<string>0.42.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/CloudflareR2SQLDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>Cloudflare R2 SQL</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/DamengDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>Dameng</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/DuckDBDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/DynamoDBDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>TableProMinAppVersion</key>
<string>0.42.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/ElasticsearchDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>TableProMinAppVersion</key>
<string>0.53.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/EtcdDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>TableProMinAppVersion</key>
<string>0.42.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/HTMLExportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesExportFormatIds</key>
<array>
<string>html</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/HanaDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>SAP HANA</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/JSONExportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesExportFormatIds</key>
<array>
<string>json</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/JSONImportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesImportFormatIds</key>
<array>
<string>json</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/KafkaDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>Kafka</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/LibSQLDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>TableProMinAppVersion</key>
<string>0.42.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/MQLExportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesExportFormatIds</key>
<array>
<string>mql</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/MSSQLDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/MarkdownExportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesExportFormatIds</key>
<array>
<string>md</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/MongoDBDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/MySQLDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>MySQL</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/OracleDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/ParquetExportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesExportFormatIds</key>
<array>
<string>parquet</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/PostgreSQLDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>PostgreSQL</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/RedisDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>NSPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).RedisPlugin</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>Redis</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/SQLExportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesExportFormatIds</key>
<array>
<string>sql</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/SQLImportPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesImportFormatIds</key>
<array>
<string>sql</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/SQLiteDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>SQLite</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/SnowflakeDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<key>TableProMinAppVersion</key>
<string>0.48.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Plugins/SpannerDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>TableProMinAppVersion</key>
<string>0.42.0</string>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>Spanner</string>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/SurrealDBDriverPlugin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>TableProPluginKitVersion</key>
<integer>33</integer>
<integer>34</integer>
<key>TableProProvidesDatabaseTypeIds</key>
<array>
<string>SurrealDB</string>
Expand Down
Loading
Loading