| 22 | }; |
| 23 | |
| 24 | interface ConnectionState { |
| 25 | connectionList: Connection[]; |
| 26 | databaseList: Database[]; |
| 27 | currentConnectionCtx?: ConnectionContext; |
| 28 | createConnection: (connection: Connection) => Connection; |
| 29 | setCurrentConnectionCtx: (connectionCtx: ConnectionContext | undefined) => void; |
| 30 | getOrFetchDatabaseList: (connection: Connection, skipCache?: boolean) => Promise<Database[]>; |
| 31 | getOrFetchDatabaseSchema: (database: Database, skipCache?: boolean) => Promise<Schema[]>; |
| 32 | getConnectionById: (connectionId: string) => Connection | undefined; |
| 33 | updateConnection: (connectionId: string, connection: Partial<Connection>) => void; |
| 34 | clearConnection: (filter: (connection: Connection) => boolean) => void; |
| 35 | } |
| 36 | |
| 37 | export const useConnectionStore = create<ConnectionState>()( |
| 38 | persist( |
nothing calls this directly
no outgoing calls
no test coverage detected