Skip to content

enzetan/db-tui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MySQL TUI

A Textual-based terminal user interface for MySQL database management, inspired by Harlequin.

Features

  • Connection Management: Save and manage multiple MySQL connections
  • Three-panel Interface:
    • Left panel: Database and table tree view
    • Top-right panel: Multi-line SQL editor with syntax highlighting
    • Bottom-right panel: Query results display
  • Keyboard Shortcuts: Full keyboard navigation support
  • Query Execution: Execute SQL queries with results display
  • Database Exploration: Browse databases, tables, and columns

Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python main.py

Usage

Keyboard Shortcuts

  • Global:

    • Ctrl+Q - Quit application
    • Ctrl+C - Open connection manager
    • Ctrl+N - Create new connection
    • Ctrl+K - Toggle help screen
  • SQL Editor:

    • Ctrl+Enter - Execute current query
    • Ctrl+Shift+Enter - Execute selected query

Connection Management

  1. On first run, you'll see the connection manager
  2. Click "New" to create a new connection
  3. Fill in connection details (host, port, username, password, database)
  4. Test and save the connection
  5. Select a connection to connect

Database Navigation

  • Use the tree view on the left to browse databases and tables
  • Click on a table to automatically generate a SELECT query
  • Execute queries in the SQL editor
  • View results in the bottom panel

Configuration

Connection configurations are saved in ~/.mysql_tui/connections.json

Project Structure

src/
├── config.py          # Configuration management
├── database.py        # MySQL connection and query handling
├── screens.py         # Connection dialogs
├── widgets.py         # UI widgets (tree, editor, results)
└── app.py            # Main application

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published