| Crates.io | sql-web |
| lib.rs | sql-web |
| version | 0.1.0 |
| created_at | 2025-06-26 08:38:12.724404+00 |
| updated_at | 2025-06-26 08:38:12.724404+00 |
| description | A web-based database browser for SQLite, MySQL, and PostgreSQL written in Rust using Rocket and SQLx. |
| homepage | https://github.com/YinMo19/sql-web |
| repository | https://github.com/YinMo19/sql-web |
| max_upload_size | |
| id | 1727047 |
| size | 608,297 |
A web-based database browser for SQLite, MySQL, and PostgreSQL written in Rust using Rocket 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.
Clone the repository:
git clone <repository-url>
cd sql-web
Build the project:
cargo build --release
The binary will be available at target/release/sql-web
# SQLite database
sql-web --database-url "sqlite://path/to/database.db"
# MySQL database
sql-web --database-url "mysql://user:password@localhost/database_name"
# PostgreSQL database
sql-web --database-url "postgres://user:password@localhost/database_name"
sql-web [OPTIONS] --database-url <DATABASE_URL>
Options:
-d, --database-url <DATABASE_URL>
Database URL (e.g., sqlite://db.sqlite, mysql://user:pass@host/db, postgres://user:pass@host/db)
-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]
-d, --debug
Enable debug mode
-h, --help
Print help
# Basic SQLite usage
sql-web --database-url "sqlite://example.db"
# Read-only SQLite
sql-web --database-url "sqlite://example.db?mode=ro" --readonly
# Connect to MySQL
sql-web --database-url "mysql://root:password@localhost/mydb"
# MySQL with custom port
sql-web --database-url "mysql://user:pass@localhost:3307/mydb"
# Connect to PostgreSQL
sql-web --database-url "postgres://user:password@localhost/mydb"
# PostgreSQL with SSL
sql-web --database-url "postgres://user:pass@localhost/mydb?sslmode=require"
Set the SQL_WEB_PASSWORD environment variable to require password authentication:
export SQL_WEB_PASSWORD="your-secret-password"
sql-web --database-url "sqlite://example.db"
If no password is set, the default password is admin.
Once started, open your web browser and navigate to:
sqlite://path/to/file.db
sqlite:///absolute/path/to/file.db
sqlite://file.db?mode=ro # Read-only mode
mysql://username:password@host:port/database
mysql://username:password@host/database # Default port 3306
postgres://username:password@host:port/database
postgresql://username:password@host:port/database
postgres://username:password@host/database?sslmode=require
cargo run -- --database-url "sqlite://test.db" --debug
sql-web/
├── src/
│ ├── main.rs # Application entry point
│ ├── config.rs # Database configuration and management
│ ├── models.rs # Data structures and models
│ └── routes/ # HTTP route handlers
│ ├── mod.rs
│ ├── index.rs # Home page and authentication
│ ├── query.rs # SQL query execution
│ ├── tables.rs # Table operations
│ ├── columns.rs # Column management
│ └── indexes.rs # Index management
├── templates/ # Askama HTML templates
├── static/ # Static assets (CSS, JS)
└── Cargo.toml
Contributions are welcome! Please feel free to submit a Pull Request.
This project is inspired by and maintains compatibility with the original sqlite-web project by Charles Leifer.