SQL Web
A single-binary web database browser for SQLite, MySQL, and PostgreSQL written in Rust with Axum, React, Tailwind, and SQLx.
This is a Rust rewrite of the Python sqlite-web project, extended to support multiple database types.
Is Still in Building. If you are willing to help me enhance the frontend looklike or help me fix bug, welcome to give me a pull request.
Features
- Multi-database support: SQLite, MySQL, and PostgreSQL
- Single binary: React frontend is built and embedded into the Rust binary
- Web-based interface: Browse and manage your databases through a browser
- Data browsing: View table contents with pagination
- SQL query execution: Run arbitrary SQL queries
- Data manipulation: Insert and update rows
- Schema management: Add/drop/rename columns and add/drop indexes
- Read-only mode: Prevent accidental modifications
- Authentication: Simple password protection
Installation
Prerequisites
- Rust 1.85 or later
- Cargo
- pnpm
Building from source
cargo build runs pnpm install when needed and pnpm build, then embeds frontend/dist into the binary.
The binary will be available at target/release/sql-web.
Usage
# SQLite database
# MySQL database
# PostgreSQL database
Command-line options
sql-web [OPTIONS] --database-url <DATABASE_URL>
Options:
-d, --database-url <DATABASE_URL>
Database URL
-H, --host <HOST>
Host to bind to [default: 127.0.0.1]
-p, --port <PORT>
Port to bind to [default: 8080]
-r, --readonly
Enable read-only mode
-R, --rows-per-page <ROWS_PER_PAGE>
Rows per page for content view [default: 50]
-Q, --query-rows-per-page <QUERY_ROWS_PER_PAGE>
Rows per page for query results [default: 1000]
--debug
Enable debug logging
-h, --help
Print help
Authentication
Set the SQL_WEB_PASSWORD environment variable to require password authentication:
If no password is set, the default password is admin.
Accessing the web interface
Once started, open your browser and navigate to:
http://localhost:8080or your custom host/port
Database URL Format
SQLite
sqlite://path/to/file.db
sqlite:///absolute/path/to/file.db
sqlite://file.db?mode=ro
MySQL
mysql://username:password@host:port/database
mysql://username:password@host/database
PostgreSQL
postgres://username:password@host:port/database
postgresql://username:password@host:port/database
postgres://username:password@host/database?sslmode=require
Development
Backend + embedded frontend
Frontend dev server
The Vite dev server proxies /api to http://127.0.0.1:8080.
Skip frontend build during cargo checks
If frontend/dist already exists and you only want to check Rust quickly:
SQL_WEB_SKIP_FRONTEND_BUILD=1
Project structure
sql-web/
├── build.rs # Builds frontend before embedding
├── frontend/ # React + Tailwind frontend
├── src/
│ ├── api/ # Axum JSON API handlers
│ ├── assets.rs # Embedded SPA static asset server
│ ├── config.rs # Database configuration and management
│ ├── main.rs # Application entry point
│ └── models.rs # Shared API data structures
└── Cargo.toml
Dependencies
- Axum: Web framework
- React + Tailwind: Frontend
- SQLx: Database connectivity
- Clap: Command-line argument parsing
License
This project is inspired by and maintains compatibility with the original sqlite-web project by Charles Leifer.