DuckDB Terminal - v0.2.0
    Preparing search index...

    Interface TerminalInterface

    Interface for interacting with the terminal from commands.

    This interface is passed to command handlers and provides methods for writing output and executing SQL.

    interface TerminalInterface {
        clear(): void;
        executeSQL(sql: string): Promise<QueryResult | null>;
        getTheme(): "dark" | "light";
        setTheme(theme: "dark" | "light"): void;
        write(text: string): void;
        writeln(text: string): void;
    }

    Implemented by

    Index

    Methods

    • Executes a SQL query and returns the result.

      Parameters

      • sql: string

        The SQL statement to execute

      Returns Promise<QueryResult | null>

      The query result, or null if an error occurred

    • Gets the current theme mode.

      Returns "dark" | "light"

      The current theme mode

    • Sets the terminal theme.

      Parameters

      • theme: "dark" | "light"

        The theme to apply ('dark' or 'light')

      Returns void

    • Writes text to the terminal without a newline.

      Parameters

      • text: string

        The text to write

      Returns void

    • Writes text to the terminal followed by a newline.

      Parameters

      • text: string

        The text to write

      Returns void