A Flask-based web dashboard for SQLite database query and management
Project description
SQLite Opus
A Flask-based web dashboard for SQLite database query and management.
Installation
pip install sqlite-opus
Or install from source:
git clone https://github.com/hungle00/sqlite-opus.git
cd sqlite-opus
pip install -e .
Quick Start
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()
Screenshots
Dashboard: tables list, table schema viewer, and SQL query editor with results.
Configuration
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
)
Configuration Options
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",
)
Features
- 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)
Development
Setup Development Environment
# 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]"
Requirements
- Python >= 3.10
- Flask >= 2.3.0
- Flask-CORS >= 4.0.0 (optional, for CORS support)
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlite_opus-0.3.1.tar.gz.
File metadata
- Download URL: sqlite_opus-0.3.1.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40278743ef2a6f209c4ed2102dd091dd70c46f9ea1127b57fa29fac29a90109f
|
|
| MD5 |
b64862ee7dddc66e6bd0484c153ac00d
|
|
| BLAKE2b-256 |
bf48c106f8786accc058797c974788dd91078c474ea3dbe7c8058b238c62316f
|
File details
Details for the file sqlite_opus-0.3.1-py3-none-any.whl.
File metadata
- Download URL: sqlite_opus-0.3.1-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4332501c7f9dccd76431a071068d2154ed9d39e9ddcb7db82279d1858b9c6f2
|
|
| MD5 |
6c7c40a2627ccd57c696e45ddd160e0d
|
|
| BLAKE2b-256 |
9e5bf3b58e1d22c80b37da63d1de074fe3f03e621786dd048c6ad58aa45872cd
|