A professional console-based SQLite database viewer and editor with an enhanced TUI interface.
- Professional TUI Interface - Navigate with arrow keys, just like Linux task managers (htop)
- Color-coded Display - Easy to read interface with visual feedback
- Database Management - Save multiple databases with custom colors
- Menu-driven Navigation - No need to remember commands
- Connect to SQLite databases - Save database path and name for quick reconnection
- Browse Tables and Schemas - View table structures and data
- Execute SQL Commands - Full SQL support for queries and modifications
- Advanced Tools - Insert, Update, Delete records and manage table structures
- Read Me - View developer information and project details
- Robust Error Handling - Professional-grade reliability
The viewer features a professional Text User Interface (TUI) similar to Linux task managers:
- Arrow Keys: Navigate menu options
- Enter: Select option
- 'q': Quit application
- 'b' or Escape: Go back to previous menu
# Run with TUI (recommended)
python -m src.core.main
# Or run the CLI version
python -c "from src.core.cli import SQLiteCLI; cli = SQLiteCLI(); cli.cmdloop()"- Connect to Database: Connect to ANY SQLite database file by entering path and name
- Browse Tables: NEW! Split-screen interface to browse tables and their contents with pagination
- Execute SQL: Run custom SQL queries
- Tools: Access advanced database tools (Insert, Update, Delete, Create Table, etc.)
- Read Me: View developer information and project details
- Disconnect: Close current database connection
- Quit: Exit the application
- Use ↑↓ arrow keys to highlight options
- Press Enter to choose
- Press 'q' to quit from any screen
- Split-Screen Layout: Table list on left, data on right
- Professional Table Format: Properly aligned columns with headers and separators
- Auto Column Sizing: Columns adjust to content with smart truncation
- Table Selection: Use ↑↓ to select tables from the left panel
- Data Pagination: Use ←→ to navigate through large tables
- Column Headers: Automatic display of column names with table separators
- Page Information: Shows current page and total rows
- Clone or download the repository
- Ensure Python 3.6+ is installed
- For Windows users, the
windows-cursespackage will be used for TUI if available - Run the application as described in Usage
- Python 3.6+
windows-curses(automatically installed for Windows)
-
Connect to a new database:
- Select "Connect to Database"
- Choose "Connect to New Database"
- Enter path:
C:\path\to\your\database.db - Enter name:
mydatabase - Select a color for the database
-
Connect to a saved database:
- Select "Connect to Database"
- Choose "Connect to Saved Database"
- Use arrow keys to select from saved databases (shown in their assigned colors)
- Press Enter to connect
- Press 'd' to delete a saved database
-
Browse and query:
- Use "Browse Tables" to open the split-screen table browser
- Use ↑↓ to select tables from the left panel
- Use ←→ to navigate through table pages on the right
- Use "Execute SQL" to run custom queries like
SELECT * FROM users WHERE age > 25
The interface remembers your saved databases with their colors and automatically reconnects to the last used database on startup!
Loula_SqLite_Viewer/
├── src/
│ ├── __init__.py # Package initialization
│ ├── core/
│ │ ├── __init__.py # Core module
│ │ ├── main.py # Application entry point
│ │ └── cli.py # Command Line Interface (CLI)
│ ├── database/
│ │ ├── __init__.py # Database module
│ │ └── database.py # Database operations
│ ├── ui/
│ │ ├── __init__.py # UI module
│ │ ├── tui.py # Text User Interface (TUI)
│ │ ├── screens.py # Screen classes for TUI
│ │ ├── table_browser.py # Table browsing functionality
│ │ └── ui_utils.py # UI utility functions
│ ├── config/
│ │ ├── __init__.py # Config module
│ │ ├── config.py # Configuration management
│ │ └── db_config.json # User configuration
│ └── tools/
│ ├── __init__.py # Tools module
│ └── tools.py # SQL tools
├── LICENSE
├── README.md # This file
└── __pycache__/
The application is organized into modular components:
-
Core Module (
src/core/): Contains the main entry point and CLI interfacemain.py: Entry point that chooses between TUI and CLI based on curses availabilitycli.py: Command-line interface for scripting and headless operation
-
Database Module (
src/database/): Handles all SQLite database operationsdatabase.py: DatabaseManager class for connecting, querying, and managing SQLite databases
-
UI Module (
src/ui/): Text User Interface componentstui.py: Main TUI class coordinating the interfacescreens.py: Individual screen classes for different menustable_browser.py: Table browsing and data display functionalityui_utils.py: Utility functions for UI operations
-
Config Module (
src/config/): Configuration and persistenceconfig.py: ConfigManager class for saving databases and settingsdb_config.json: JSON file storing saved databases and last connection
-
Tools Module (
src/tools/): SQL and utility toolstools.py: SQLTools class for executing queries and SQL operations
-
Startup:
main.pychecks for curses library availability- If available, launches TUI mode with
SQLiteTUI - If not, falls back to CLI mode with
SQLiteCLI
- If available, launches TUI mode with
-
TUI Mode: Uses curses for full-screen text interface
SQLiteTUImanages the main loop and menu navigation- Delegates to
ConnectionScreensfor connection management - Uses
TableBrowserfor data browsing - Leverages
SQLToolsfor query execution
-
Database Operations: All database interactions go through
DatabaseManager- Connects to SQLite files
- Executes queries and fetches results
- Manages connections and transactions
-
Configuration:
ConfigManagerhandles persistence- Saves database connections with colors
- Remembers last connected database
- Stores settings in JSON format
-
CLI Mode: Command-line interface for automation
- Interactive shell with commands like
connect,select, etc. - Useful for scripting and headless environments
- Interactive shell with commands like
-
Clone the repository:
git clone https://github.com/SilverLucFox/Loula_SqLite_Viewer.git cd Loula_SqLite_Viewer -
Install the package:
# Install in development mode (recommended for development) pip install -e . # Or install normally pip install .
-
Run the application:
sqlite-viewer # or loula-sqlite
pip install loula-sqlite-viewer
sqlite-viewer-
Install build dependencies:
pip install pyinstaller build
-
Build the executable:
python build_app.py # Choose option 1 for executable only # Choose option 5 to clean build artifacts first
-
Run the executable:
# On Windows dist/sqlite-viewer.exe # On Linux/macOS dist/sqlite-viewer
-
Clone and install in development mode:
git clone https://github.com/SilverLucFox/Loula_SqLite_Viewer.git cd Loula_SqLite_Viewer pip install -e ".[dev]"
-
Run tests:
pytest
-
Code formatting:
black src/ flake8 src/
# Install build tools
pip install build twine
# Build distributions
python -m build
# Upload to PyPI (optional)
twine upload dist/*# Install PyInstaller
pip install pyinstaller
# Run build script
python build_app.py- Python: 3.6 or higher
- Operating System: Windows, Linux, or macOS
- Dependencies:
windows-curses(automatically installed on Windows)- Standard library modules:
sqlite3,json,os,curses
The application can be distributed as:
- Python Package: Installable via pip
- Standalone Executable: Single file executable (no Python installation required)
- Source Distribution: For manual installation
-
"curses module not found" on Windows:
pip install windows-curses
-
Permission denied when running executable:
- On Linux/macOS:
chmod +x dist/sqlite-viewer - On Windows: Run as administrator or check antivirus
- On Linux/macOS:
-
Import errors:
- Ensure you're running from the correct directory
- Try reinstalling:
pip install -e .
- Check the Issues page
- Review the README for usage instructions
- Test with the CLI mode if TUI has issues:
python -c "from src.core.cli import SQLiteCLI; cli = SQLiteCLI(); cli.cmdloop()"