DuckDB Terminal - Library Entry Point
This module provides the main entry point for embedding a DuckDB-powered SQL terminal in web applications. It exports factory functions for creating terminals, as well as all necessary types and utilities.
import { createTerminal } from 'duckdb-terminal';const terminal = await createTerminal({ container: '#terminal', theme: 'dark',});// Execute SQL programmaticallyconst result = await terminal.executeSQL('SELECT 1 + 1 as answer');console.log(result); // { columns: ['answer'], rows: [[2]], rowCount: 1, duration: 5 } Copy
import { createTerminal } from 'duckdb-terminal';const terminal = await createTerminal({ container: '#terminal', theme: 'dark',});// Execute SQL programmaticallyconst result = await terminal.executeSQL('SELECT 1 + 1 as answer');console.log(result); // { columns: ['answer'], rows: [[2]], rowCount: 1, duration: 5 }
import { createTerminal } from 'duckdb-terminal';const terminal = await createTerminal({ container: document.getElementById('terminal'), theme: 'dark',});terminal.on('queryEnd', ({ sql, result, duration }) => { console.log(`Query completed in ${duration}ms`);}); Copy
import { createTerminal } from 'duckdb-terminal';const terminal = await createTerminal({ container: document.getElementById('terminal'), theme: 'dark',});terminal.on('queryEnd', ({ sql, result, duration }) => { console.log(`Query completed in ${duration}ms`);});
DuckDB Terminal - Library Entry Point
This module provides the main entry point for embedding a DuckDB-powered SQL terminal in web applications. It exports factory functions for creating terminals, as well as all necessary types and utilities.
Example: Basic usage
Example: With event listeners