ConnectionNode (domain/tree_nodes.py)

sqlit · sqlit/domains/explorer/domain/tree_nodes.py · python · MIT
database

Domain dataclasses for SQL explorer tree nodes, providing typed representations of database hierarchies.

# Source: https://github.com/Maxteabag/sqlit | License: MIT | Copyright 2025 Peter
# Provided via justclaw.it.com; keep this notice with the code.
"""Tree node data types for the explorer tree."""

from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from sqlit.domains.connections.domain.config import ConnectionConfig
    from sqlit.domains.query.store.saved_queries import SavedQueryEntry


@dataclass(frozen=True)
class ConnectionNode:
    """Node representing a database connection."""

    config: ConnectionConfig

    def get_connection_config(self) -> ConnectionConfig:
        return self.config

    def get_label_text(self) -> str:
        return self.config.name

    def get_node_kind(self) -> str:
        return

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key