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

    Interface TerminalEvents

    Event payload types for all terminal events.

    Use with DuckDBTerminal.on to subscribe to events.

    terminal.on('queryEnd', (event: TerminalEvents['queryEnd']) => {
    console.log(`Query took ${event.duration}ms`);
    });
    interface TerminalEvents {
        commandExecute: { args: string[]; command: string };
        error: { message: string; source: string };
        fileLoaded: { filename: string; size: number; type: string };
        queryEnd: {
            duration: number;
            error?: string;
            result: QueryResult | null;
            sql: string;
        };
        queryStart: { sql: string };
        ready: Record<string, never>;
        stateChange: { previous: TerminalState; state: TerminalState };
        themeChange: { previous: Theme | null; theme: Theme };
    }
    Index

    Properties

    commandExecute: { args: string[]; command: string }

    Emitted when a dot command is executed.

    Type Declaration

    • args: string[]

      Command arguments

    • command: string

      The command name (e.g., '.help')

    error: { message: string; source: string }

    Emitted when an error occurs.

    Type Declaration

    • message: string

      The error message

    • source: string

      Where the error originated (e.g., 'query', 'command')

    fileLoaded: { filename: string; size: number; type: string }

    Emitted when a file is loaded via drag-and-drop or file picker.

    Type Declaration

    • filename: string

      The filename

    • size: number

      File size in bytes

    • type: string

      File extension/type

    queryEnd: {
        duration: number;
        error?: string;
        result: QueryResult | null;
        sql: string;
    }

    Emitted when a SQL query completes (success or failure).

    Type Declaration

    • duration: number

      Execution time in milliseconds

    • Optionalerror?: string

      Error message if the query failed

    • result: QueryResult | null

      The query result, or null if the query failed

    • sql: string

      The SQL statement that was executed

    queryStart: { sql: string }

    Emitted when a SQL query starts executing.

    Type Declaration

    • sql: string

      The SQL statement being executed

    ready: Record<string, never>

    Emitted when the terminal is fully initialized and ready for input. The payload is an empty object.

    stateChange: { previous: TerminalState; state: TerminalState }

    Emitted when the terminal state changes.

    Type Declaration

    • previous: TerminalState

      The previous state

    • state: TerminalState

      The new state

    themeChange: { previous: Theme | null; theme: Theme }

    Emitted when the terminal theme changes.

    Type Declaration

    • previous: Theme | null

      The previous theme (null if this is the initial theme)

    • theme: Theme

      The new theme