Local SQL is a web based, local-first modern database browser. Visit localsql.dev, add connection and start browsing your tables.
Important
This project is under heavy development, check TODO section for current progress. Some things can be broken, some are missing
- Privacy-Focused Your database connection details are stored exclusively in SQLite database on your computer. No sensitive data is ever transmitted to or shared with any external services - only your locally running server.
- Local Server A simple command-line tool initiates a local web server, enabling secure communication between your browser and databases. This ensures all database operations are performed locally on your machine.
- Secure Gateway Connect multiple
local-sqlinstances together to manage all your databases from a single interface. This is perfect for accessing databases in isolated environments without exposing them publicly. - Built-in Docker Image Official Images on GHCR and Docker Hub let you containerize Local SQL and connect to non-exposed databases securely.
- Token-Based Authentication Generate
readorwriteaccess token to secure public instances of Local-SQL.
- Implement data fetching and data viewer
- Inserting and updating data
- Implement pagination
- Schema visualizer
- Role based access control (per-database, improve permission: read-only, read & write, admin)
- SQL query runner and natural-language support using AI
- Add more database adapters
- Add documentation
- Theming options (tweakcn?)
- Manage existing servers & connections
- Explore different way to save connections (in browser local-storage vs server db with os app data directory)
- Server key generation (for gateways), permissions
- Better building process and CLI
- Docker image for local-sql API
Try out Local SQL online dashboard or run app locally:
# Bun.js
bunx --bun local-sql@latest
# pnpm
pnpm dlx local-sql@latest
# Node.js
npx local-sql@latest-V, --versionoutput the version number-p, --port <number>specify the app port number--no-uirun API only (no web UI)--no-apirun web UI only (no API)--verboseenable detailed logs-h, --helpdisplay help for command
Local SQL (API) is also available as a Docker image on:
- Github Container Registry:
ghcr.io/martiinii/local-sql:latest - Docker Hub:
martiinii/local-sql:latest
Use Docker compose to run:
services:
local-sql:
image: ghcr.io/martiinii/local-sql:latest
container_name: local-sql
restart: unless-stopped
# --- Security best-practice
# 1. Start the container WITHOUT REQUIRE_TOKEN to initialize.
# 2. Visit https://localsql.dev or start local-sql locally, connect to this instance of local-sql API and generate write token. Then edit server connection and paste generated token.
# 3. Uncomment the block below to enforce token authentication:
# environment:
# REQUIRE_TOKEN: "true"
# 4. Restart the container; all connections will now require your token.
volumes:
- lsql:/app/db
ports:
- "57597:57597"
volumes:
lsql:- React
- Next.js
- Elysia
- shadcn/ui
- Radix Primitives
- Tailwind
- Zustand
- Turborepo
- drizzle-orm
- Bun
- TypeScript
And a huge thank you to the creators of the many other open-source dependencies that make this project possible.
- Etienne - for generously providing
local-sqlpackage name - check-site-meta - inspiration for CLI tool (and Next.js standalone output to npm package)
- better-auth - for awesome CI release workflow
- drizzle-orm -
drizzle-studiowas my source of inspiration forlocal-sql