Skip to main content

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

SQLite Opus Dashboard

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 startup
  • enable_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: If True, 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

sqlite_opus-0.3.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlite_opus-0.3.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file sqlite_opus-0.3.0.tar.gz.

File metadata

  • Download URL: sqlite_opus-0.3.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for sqlite_opus-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c43ffdfc8f58e2780c15dfe95efcb7a680c2283a1567f0a1a6de27267a116237
MD5 cbd0f3f76baa4482d941f43b9577f0df
BLAKE2b-256 7c5f06ba541acc947418c59f7df433226bffc44b519a83de4416c7d0df713534

See more details on using hashes here.

File details

Details for the file sqlite_opus-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: sqlite_opus-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for sqlite_opus-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ce1b55f9b87093f53aaa72aa98141149f20506c3c700efc49a70d6cb9e4ae57
MD5 11f4fed958a83147276b4ee365244a60
BLAKE2b-256 b34b0bfe401eb089536f99667300ad68862a8f7dedbaf651a2e6f933546c9b4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page