Skip to content

A native macOS / windows / Linux database IDE built with Swift and AppKit. Connect to PostgreSQL, MySQL, SQLite, and Redis from a single app with a fast, keyboard-driven interface.

C++

fix(postgres): persist SSL certificate paths

cyenxa55af30a0390
diff --git a/macos/Data/Persistence/Models/SavedConnectionEntity.swift b/macos/Data/Persistence/Models/SavedConnectionEntity.swift
index 799741e..b462edf 100644
--- a/macos/Data/Persistence/Models/SavedConnectionEntity.swift
+++ b/macos/Data/Persistence/Models/SavedConnectionEntity.swift
@@ -19,6 +19,10 @@ final class SavedConnectionEntity {
/// Fine-grained SSL posture (raw value of `SSLMode`). Optional for SwiftData
/// lightweight migration of pre-existing rows. Read site falls back to `sslEnabled`.
var sslMode: String?
+ /// Optional SSL certificate paths. Kept optional for lightweight migration.
+ var sslKeyPath: String?
+ var sslCertPath: String?
+ var sslCACertPath: String?
var sshEnabled: Bool
var sshHost: String?
var sshPort: Int?
@@ -46,6 +50,9 @@ final class SavedConnectionEntity {
username: String? = nil,
sslEnabled: Bool = false,
sslMode: String? = nil,
+ sslKeyPath: String? = nil,
+ sslCertPath: String? = nil,
+ sslCACertPath: String? = nil,
sshEnabled: Bool = false,
sshHost: String? = nil,
sshPort: Int? = nil,
@@ -70,6 +77,9 @@ final class SavedConnectionEntity {
self.username = username
self.sslEnabled = sslEnabled
self.sslMode = sslMode
+ self.sslKeyPath = sslKeyPath
+ self.sslCertPath = sslCertPath
+ self.sslCACertPath = sslCACertPath
self.sshEnabled = sshEnabled
self.sshHost = sshHost
self.sshPort = sshPort
@@ -120,6 +130,9 @@ final class SavedConnectionEntity {
sslMode: sslMode.flatMap { SSLMode(rawValue: $0) },
colorTag: colorTag.flatMap { ColorTag(rawValue: $0) },
group: group,
+ sslKeyPath: sslKeyPath,
+ sslCertPath: sslCertPath,
+ sslCACertPath: sslCACertPath,
filePath: filePath,
sshConfig: sshConfig,
mcpMode: mcpMode.flatMap { MCPConnectionMode(rawValue: $0) } ?? .locked,
diff --git a/macos/Data/Persistence/Repositories/SwiftDataConnectionRepository.swift b/macos/Data/Persistence/Repositories/SwiftDataConnectionRepository.swift
index 4d7baa7..5ab992e 100644
--- a/macos/Data/Persistence/Repositories/SwiftDataConnectionRepository.swift
+++ b/macos/Data/Persistence/Repositories/SwiftDataConnectionRepository.swift
@@ -56,6 +56,9 @@ final class SwiftDataConnectionRepository: ConnectionRepository, @unchecked Send
username: config.username,
sslEnabled: config.sslEnabled,
sslMode: config.sslMode?.rawValue,
+ sslKeyPath: config.sslKeyPath,
+ sslCertPath: config.sslCertPath,
+ sslCACertPath: config.sslCACertPath,
sshEnabled: config.sshConfig != nil,
sshHost: config.sshConfig?.host,
sshPort: config.sshConfig?.port,
@@ -90,6 +93,9 @@ final class SwiftDataConnectionRepository: ConnectionRepository, @unchecked Send
entity.username = config.username
entity.sslEnabled = config.sslEnabled
entity.sslMode = config.sslMode?.rawValue
+ entity.sslKeyPath = config.sslKeyPath
+ entity.sslCertPath = config.sslCertPath
+ entity.sslCACertPath = config.sslCACertPath
entity.colorTag = config.colorTag?.rawValue
entity.group = config.group
entity.filePath = config.filePath