# ADR-0001: Language and TUI framework

## Status

Accepted

## Context

RDBMS Playground is a cross-platform terminal application aimed at
learners. It needs to feel fast, polished, and colourful, install
cleanly on Linux, macOS, and Windows, and ship as a single binary
with no runtime dependencies.

Beyond TUI rendering, the application has substantial SQL-handling
needs: syntax highlighting, parsing user input to distinguish app
DSL commands from SQL, rewriting simplified types into backend
types, and analysing query plans for the teaching features.

Two stacks were realistic candidates:

1. **Rust + Ratatui + Crossterm** — strong cross-platform terminal
   support, single static binary, mature ecosystem. Crucially,
   `sqlparser-rs` is a high-quality dialect-aware SQL parser
   directly applicable to the parsing, highlighting, and query
   analysis features.
2. **Go + Bubble Tea (Charm)** — excellent default aesthetics,
   single static binary, easy distribution. Lacks an equivalent to
   `sqlparser-rs`; SQL parsing would need to be written from
   scratch or wrap a less suitable library.

## Decision

Use **Rust with Ratatui and Crossterm** for the TUI, with
`sqlparser-rs` for SQL parsing and `rusqlite` for the database
layer. Distribute as prebuilt binaries via GitHub releases plus
package managers (`cargo binstall`, Homebrew, Scoop, `winget`).

## Consequences

- Single static binary on all three target platforms.
- Strong fit between SQL-heavy features and the Rust SQL ecosystem
  (`sqlparser-rs`, `rusqlite`).
- Slightly steeper contributor on-ramp for developers unfamiliar
  with Rust compared to Go.
- TUI styling will require explicit work to match the polish that
  Bubble Tea / Lipgloss give for free; budget for it in the design
  pass.
