Minimal SQL editor for Tusk. Hand-rolled tokenizer (no regex — Perry AOT constraint), per-line colorized rendering on top of perry/ui.
No autocomplete or LSP integration in v1.
bun add @tusk/sql-editor # or, when developing alongside Tusk: # "@tusk/sql-editor": "file:../tusk-sql-editor"
import { SqlEditor } from '@tusk/sql-editor'; const { handle, api } = SqlEditor({ initialText: 'SELECT * FROM users LIMIT 100', onRun(sql) { /* … */ }, onCancel() { /* … */ }, });
Pre-D3: placeholder widget that renders the SQL text inline. Real multiline editor with token highlighting, ⌘↩ to run, and ⌘. to cancel land in milestone D3 of the Tusk plan.
MIT.