A Flask-based web dashboard for SQLite database query and management.
pip install sqlite-opusOr install from source:
git clone https://github.com/hungle00/sqlite-opus.git
cd sqlite-opus
pip install -e .SQLite Opus can be used as a library, similar to Flask-MonitoringDashboard:
from flask import Flask
import sqlite_opus as dashboard
app = Flask(__name__)
# Bind the dashboard to your Flask app
dashboard.bind(app)
# The dashboard will be available at http://localhost:5000/sqlite-opus
app.run()Dashboard: tables list, table schema viewer, and SQL query editor with results.
You can customize the dashboard configuration:
import sqlite_opus as dashboard
# Option 1: Configure before binding
dashboard.config.url_prefix = "my-dashboard"
dashboard.config.max_query_results = 500
dashboard.bind(app)
# Option 2: Configure during binding
dashboard.bind(
app,
url_prefix="my-dashboard",
max_query_results=500,
enable_cors=True
)url_prefix: URL prefix for dashboard routes (default:"sqlite-opus")db_path: Path to a SQLite database file for auto-connect on startupenable_cors: Enable CORS support (default:True)auth_user/auth_password: HTTP Basic Auth for all dashboard routes (optional). When both are set, every request must supply valid credentials.allow_dml: IfTrue, allow write queries (INSERT/UPDATE/DELETE/CREATE/…). Default:False(read-only).
Security (production): Use Basic Auth and keep allow_dml disabled in production for a more secure setup. Example:
dashboard.bind(
app,
auth_user="admin",
auth_password="your-strong-password",
allow_dml=False, # read-only
db_path="data.db",
)- Web-based SQLite Query Interface: Execute SQL queries through a web dashboard
- Database Connection Management: Connect to and disconnect from SQLite databases
- Table Schema Viewer: View table structures and schemas
- Query Results Display: View query results in a formatted table with pagination (powered by the paginate library)
# Create virtual environment
python3.10 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"- Python >= 3.10
- Flask >= 2.3.0
- Flask-CORS >= 4.0.0 (optional, for CORS support)
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
