From d8218307e61214d217d77c166bfc3b1a8483ed5c Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Tue, 21 Jul 2026 22:53:37 +0700 Subject: [PATCH] fix(connections): unwrap optional session.driver in the metadata pool Claude-Session: https://claude.ai/code/session_01FYwKEwKydeMG6WAHucMdY9 --- TablePro/Core/Services/Query/MetadataConnectionPool.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TablePro/Core/Services/Query/MetadataConnectionPool.swift b/TablePro/Core/Services/Query/MetadataConnectionPool.swift index 51c2e0b93..ec3987c1f 100644 --- a/TablePro/Core/Services/Query/MetadataConnectionPool.swift +++ b/TablePro/Core/Services/Query/MetadataConnectionPool.swift @@ -111,8 +111,10 @@ final class MetadataConnectionPool { ) async throws -> Entry { if let session = DatabaseManager.shared.session(for: connectionId), session.connection.type.supportsConnectionPooling == false { - guard session.driver.status == .connected else { throw DatabaseError.notConnected } - return Entry(driver: session.driver, ownsDriver: false) + guard let driver = session.driver, driver.status == .connected else { + throw DatabaseError.notConnected + } + return Entry(driver: driver, ownsDriver: false) } let key = Key(connectionId: connectionId, database: database, schema: schema, workload: workload)