Skip to content

Commit 9b76a31

Browse files
committed
feat: show all database types in connection form with install status badge (#418)
1 parent 1ebf8bf commit 9b76a31

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Keyboard focus navigation (Tab, Ctrl+J/K/N/P, arrow keys) for connection list, quick switcher, and database switcher
1313
- MongoDB `mongodb+srv://` URI support with SRV toggle, Auth Mechanism dropdown, and Replica Set field (#419)
14+
- Show all available database types in connection form with install status badge (#418)
1415

1516
### Changed
1617

TablePro/Core/Plugins/PluginManager.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,14 @@ final class PluginManager {
647647
return types.sorted { $0.rawValue < $1.rawValue }
648648
}
649649

650+
var allAvailableDatabaseTypes: [DatabaseType] {
651+
var types = Set(availableDatabaseTypes)
652+
for type in DatabaseType.allKnownTypes {
653+
types.insert(type)
654+
}
655+
return types.sorted { $0.rawValue < $1.rawValue }
656+
}
657+
650658
// MARK: - Driver Availability
651659

652660
func isDriverAvailable(for databaseType: DatabaseType) -> Bool {

TablePro/Views/Connection/ConnectionFormView.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct ConnectionFormView: View { // swiftlint:disable:this type_body_length
2727
private var isNew: Bool { connectionId == nil }
2828

2929
private var availableDatabaseTypes: [DatabaseType] {
30-
PluginManager.shared.availableDatabaseTypes
30+
PluginManager.shared.allAvailableDatabaseTypes
3131
}
3232

3333
private var additionalConnectionFields: [ConnectionField] {
@@ -237,9 +237,12 @@ struct ConnectionFormView: View { // swiftlint:disable:this type_body_length
237237
HStack {
238238
Text(t.rawValue)
239239
if t.isDownloadablePlugin && !PluginManager.shared.isDriverLoaded(for: t) {
240-
Image(systemName: "arrow.down.circle")
241-
.foregroundStyle(.secondary)
240+
Text("Not Installed")
242241
.font(.caption)
242+
.foregroundStyle(.secondary)
243+
.padding(.horizontal, 4)
244+
.padding(.vertical, 1)
245+
.background(.quaternary, in: RoundedRectangle(cornerRadius: 3))
243246
}
244247
}
245248
} icon: {

0 commit comments

Comments
 (0)