-
-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathConnectionSession.swift
More file actions
30 lines (28 loc) · 1.05 KB
/
ConnectionSession.swift
File metadata and controls
30 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import Foundation
import TableProModels
/// Note: Views hold a snapshot of this struct. Mutable fields (activeDatabase, status)
/// are only updated through ConnectionManager.updateSession and should be re-fetched
/// from the manager when needed rather than read from a held copy.
public struct ConnectionSession: Sendable {
public let connectionId: UUID
public let driver: any DatabaseDriver
public internal(set) var activeDatabase: String
public internal(set) var currentSchema: String?
public internal(set) var status: ConnectionStatus
public internal(set) var tables: [TableInfo]
public init(
connectionId: UUID,
driver: any DatabaseDriver,
activeDatabase: String,
currentSchema: String? = nil,
status: ConnectionStatus = .connected,
tables: [TableInfo] = []
) {
self.connectionId = connectionId
self.driver = driver
self.activeDatabase = activeDatabase
self.currentSchema = currentSchema
self.status = status
self.tables = tables
}
}