Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- iOS: row detail pager no longer carries the index-based row iteration that caused the build 11 filter crash. A recent refactor reintroduced the pattern; row detail now uses the same identity-based row wrapping the data browser does.
- Tables in the sidebar now load automatically after a slow connect. SQL Server connections previously showed "No Tables" until the user manually picked a schema; the same race could affect other engines on slow networks. The post-connect listener now triggers the schema load once the driver is bound.
- SQL Server `switchDatabase` now actually switches the database (`USE <database>`) instead of being routed through a schema switch. Switching from a saved tab pointing at a different database used to overwrite the current schema with the database name and leave the table list empty until the user manually re-picked a schema.
- SQL Server cell edits now save without "Conversion failed when converting date and/or time from character string." Tables with primary keys use a PK-only WHERE clause (no longer including every column), and DATETIME / DATETIME2 / SMALLDATETIME values round-trip as ISO 8601 instead of FreeTDS's `MMM d yyyy h:mm:ss:fffAM` format that SQL Server's parser rejects.
Expand Down
10 changes: 5 additions & 5 deletions TableProMobile/TableProMobile/Helpers/IndexedRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Foundation
/// Identifiable wrapper used by iOS lists that need both the row payload and
/// its position index. Iterating over `[IndexedRow]` instead of
/// `rows.indices` keeps SwiftUI's `ForEach` diff stable when the underlying
/// `[[String?]]` shrinks mid-renderthe pattern that caused the
/// `Array._checkSubscript` crashes in release 1.0 (build 11).
struct IndexedRow: Identifiable {
/// row collection shrinks mid-render. This is the pattern that prevents the
/// `Array._checkSubscript` crashes seen in release 1.0 (build 11).
struct IndexedRow<Element>: Identifiable {
let id: Int
let values: [String?]
let values: Element

static func wrap(_ rows: [[String?]]) -> [IndexedRow] {
static func wrap(_ rows: [Element]) -> [IndexedRow<Element>] {
rows.enumerated().map { IndexedRow(id: $0.offset, values: $0.element) }
}
}
6 changes: 3 additions & 3 deletions TableProMobile/TableProMobile/Views/RowDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ struct RowDetailView: View {
rowContent(at: viewModel.currentIndex)
} else {
TabView(selection: $viewModel.currentIndex) {
ForEach(viewModel.rows.indices, id: \.self) { index in
rowContent(at: index)
.tag(index)
ForEach(IndexedRow.wrap(viewModel.rows)) { item in
rowContent(at: item.id)
.tag(item.id)
}
}
.tabViewStyle(.page(indexDisplayMode: .never))
Expand Down
Loading