Web REPL
Browser-based SQL console for interactive data exploration and prototyping.
Starting the REPL
The Web REPL launches a local HTTP server and opens a browser-based SQL console connected to the TeideDB engine via WebSocket.
npm run build # first time only
npm run repl # start server (open browser manually)
node bin/teide.js # start server + auto-open browser
The REPL opens at http://127.0.0.1:3141. If port 3141 is busy, the server automatically increments to the next available port. Stop the server with Ctrl+C.
Interface Overview
The REPL interface is organized into several regions:
- Top bar: Teide logo, Help and Clear buttons.
- Left sidebar: An icon rail that toggles the Tables panel (with a filter input and expandable column tree) and the History panel.
- Editor: A CodeMirror 6 editor with SQL syntax highlighting, autocomplete, and Ctrl+Enter to execute the current query.
- Bottom pane: Tabbed area with Output (result table), Log (query history), and Console (JavaScript eval).
- Footer: Connection status indicator showing the WebSocket state.
Loading Data
Use the .load dot-command to import CSV files. The table name defaults to the file’s base name, or you can specify one explicitly with as:
.load /path/to/sales.csv
.load /path/to/data.csv as mydata
You can also load data using SQL with read_csv():
SELECT * FROM read_csv('/path/to/sales.csv');
CREATE TABLE sales AS SELECT * FROM read_csv('/path/to/sales.csv');
Specifying Column Types
By default, column types are auto-detected. To override them, pass a comma-separated type list as a second argument:
.load data.csv types i32,sym,f64,i64
.load data.csv as sales types i32,sym,f64,i64
Or in SQL:
SELECT * FROM read_csv('data.csv', 'i32,sym,f64,i64');
CREATE TABLE t AS SELECT * FROM read_csv('data.csv', 'i32,sym,f64,i64');
Valid types: bool, u8, i16, i32, i64, f64, sym, date, time, timestamp. The type list must match the number of columns in the CSV.
Running Queries
Type SQL in the editor and press Ctrl+Enter to execute. Results appear in the Output tab below the editor.
SELECT * FROM sales;
SELECT category, SUM(price) AS total
FROM sales
GROUP BY category;
SELECT * FROM sales
WHERE price > 100
ORDER BY price DESC
LIMIT 10;
Dot-Commands
Dot-commands are special directives that control the REPL environment. They are not SQL statements and do not require a semicolon.
| Command | Description |
|---|---|
.help | Show available dot-commands and usage information. |
.tables | List all tables currently loaded in the session. |
.schema [table] | Show the column names and types for a table, or all tables if no argument is given. |
.load <path> [as name] [types t1,t2,...] | Load a CSV file into a table, optionally specifying column types. |
.save <table> <path> | Export a table to a CSV file on disk. |
.timer | Toggle query execution timing display. |
.clear | Clear the output pane. |
Autocomplete
The editor provides context-aware SQL autocomplete powered by the server:
- Triggers automatically after typing 2 or more characters.
- Press Tab to accept the selected suggestion, or Escape to dismiss the popup.
- After
FROMorJOIN, suggests table names from the current session. - After
SELECT,WHERE,ORDER BY, and other column contexts, suggests column names from referenced tables.
Bottom Pane Tabs
Output
Displays query results as a formatted table with virtual scrolling for large result sets. Column headers show the column name and data type. Dashed separators divide the header from the data rows. Use the toolbar buttons to Download CSV, Download JSON, or Copy the results to the clipboard.
Log
An append-only query log that records every executed statement with its timestamp, success/error status, and execution time in milliseconds.
Console
A JavaScript REPL for ad-hoc scripting. Type any JavaScript expression and press Enter to evaluate it. Use the Up and Down arrow keys to navigate through command history.
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl+Enter | Execute the current query in the editor. |
| Tab | Accept the selected autocomplete suggestion. |
| Escape | Dismiss the autocomplete popup. |
| Double-click tab | Rename a bottom pane tab. |
| Up / Down (in Console) | Navigate through Console command history. |