How tconbeer/harlequin works
Main Components
a. Core Application Layer:
• Terminal UI (built with Textual, evident from .tcss files)
• Command Line Interface (cli.py)
• Configuration Management (config.py)
• Plugin System (plugins.py)
b. Editor Components:
• Code Editor with SQL syntax highlighting
• Results Viewer
• Data Catalog Browser
• Query History Manager
• Help System
c. Database Layer:
• Abstract Adapter Interface (adapter.py)
• Built-in Adapters:
• DuckDB Implementation
• SQLite Implementation
• Plugin System for External Adapters
d. Support Systems:
• Autocomplete Engine
• Cache Management
• Export Functionality
• History Management
┌─ User Interface Layer ─────────────────────┐
• Terminal UI (Textual) │
• ┌─────────────┐ ┌──────────┐ ┌──────────┐ │
• Code Editor │ │ Data │ │ Results │ │
• Catalog │ │ Viewer │ │
• ┘ └──────────┘ └──────────┘ │
• ┤
• Core Application Layer │
• ┌─────────────┐ ┌──────────┐ ┌──────────┐ │
• Config │ │ Plugin │ │ Cache │ │
• Management │ │ System │ │ System │ │
• ┘ └──────────┘ └──────────┘ │
• ┤
• Database Abstraction Layer │
• ┌─────────────┐ ┌──────────┐ ┌──────────┐ │
• Base │ │ Query │ │ Schema │ │
• Adapter │ │ Engine │ │ Manager │ │
• ┘ └──────────┘ └──────────┘ │
• ┤
• Database Implementations │
• ┌─────────────┐ ┌──────────┐ ┌──────────┐ │
• DuckDB │ │ SQLite │ │ External │ │
• Adapter │ │ Adapter │ │ Adapters │ │
• ┘ └──────────┘ └──────────┘ │
• ┘
Important Details to Highlight
• Plugin architecture for database adapters
• File system interactions for query history and caching
• Configuration flow from CLI to components
• Autocomplete system integration
• Export functionality paths