Blob: README.md
MySQL Dump Browser
Browser-based viewer for MySQL dump files, powered by React + vinext + sql.js.
It imports SQL dumps into an in-browser SQLite engine, then lets you browse tables and run ad-hoc queries.
Features
- Client-side import of
.sqland.sql.gzfiles - MySQL-to-SQLite statement rewriting for common dump patterns
- SQL execution in a Web Worker (UI stays responsive)
- Import progress updates + cancel support
- Table list, pagination, and custom query panel
Requirements
- Node.js 18+
- npm 9+
Local development
npm install
npm run devOpen: http://localhost:3000
Useful scripts:
npm run check
npm run build
npm run startImport notes
Single-file dumps
Most standard mysqldump exports work directly.
Multi-file scripts (for example datacharmer/test_db)
employees.sql from test_db references other files via SOURCE ... statements.
A browser file upload cannot automatically open those referenced local files.
Current behavior:
SOURCEstatements are detected and logged as hints- You should import the referenced
.dumpfiles manually after importingemployees.sql
Suggested order for test_db:
employees.sqlload_departments.dumpload_employees.dumpload_dept_emp.dumpload_dept_manager.dumpload_titles.dumpload_salaries1.dumpload_salaries2.dumpload_salaries3.dump
Deploy to Cloudflare Workers
vinext includes first-class Workers deploy support.
1) One-time setup
Authenticate Wrangler:
npx wrangler login(For CI, use CLOUDFLARE_API_TOKEN instead of interactive login.)
2) Deploy
Preview what vinext will generate:
npm run deploy:dry-runDeploy to production:
npm run deployDeploy to preview environment:
npm run deploy:previewvinext deploy auto-generates missing Worker config and runs Wrangler deploy.
Attach a custom domain
Option A (recommended): Cloudflare Dashboard
- Go to Workers & Pages
- Open this Worker
- Go to Settings → Domains & Routes
- Click Add → Custom Domain
- Enter your domain/subdomain (for example
sql.example.com) - Save and wait for certificate issuance
Option B: Wrangler config as code
Add a custom domain route in your Worker config (wrangler.jsonc or wrangler.toml), then deploy.
wrangler.toml example:
[[routes]]
pattern = "sql.example.com"
custom_domain = trueThen:
npx wrangler deployNotes
- Custom domains work when your DNS zone is on Cloudflare.
- If a record already exists for the same hostname, remove/replace it before attaching the Worker custom domain.