mirror of
https://github.com/taigrr/teaqlite.git
synced 2026-04-01 20:49:05 -07:00
a2e5d43fe0488da7a0154abce1e8914d0271f198
SQLite TUI
A fully-featured terminal user interface for browsing SQLite databases built with Bubble Tea v2.
Features
- Table Browser: Browse all tables in your SQLite database with pagination
- Search Functionality: Search tables by name using
/key - Data Viewer: View table data with pagination (20 rows per page)
- SQL Query Interface: Execute custom SQL queries with parameter support
- Responsive Design: Adapts to terminal size and fits content to screen
- Navigation: Intuitive keyboard navigation
Usage
go run main.go <database.db>
Example with the included sample database:
go run main.go sample.db
Keyboard Controls
Table List Mode
↑/↓ork/j: Navigate between tables←/→orh/l: Navigate between table list pages/: Start searching tablesEnter: View selected table datas: Switch to SQL query moder: Refresh table listqorCtrl+C: Quit
Search Mode (when searching tables)
- Type to search table names
EnterorEsc: Finish searchBackspace: Delete characters
Table Data Mode
←/→orh/l: Navigate between data pagesEsc: Return to table listr: Refresh current table dataqorCtrl+C: Quit
SQL Query Mode
- Type your SQL query
Enter: Execute queryBackspace: Delete charactersEsc: Return to table listqorCtrl+C: Quit
Features Implemented
- Table Browsing: Lists all tables in the database with pagination
- Table Search: Filter tables by name using
/to search - Paginated Data View: Shows table data with pagination (20 rows per page)
- Screen-Aware Display: Content automatically fits terminal size
- SQL Query Execution: Execute custom SQL queries and view results
- Error Handling: Displays database errors gracefully
- Responsive UI: Clean, styled interface that adapts to terminal size
- Column Information: Shows column names and handles NULL values
- Navigation: Intuitive keyboard shortcuts for all operations
- Dynamic Column Width: Columns adjust to terminal width
Sample Database
The included sample.db contains:
userstable with id, name, email, age columnsproductstable with id, name, price, category columns
Dependencies
- Bubble Tea - TUI framework
- Lip Gloss - Styling
- go-sqlite3 - SQLite driver
Languages
Go
100%