View SQLite file online directly in your browser.
The database will be loaded into your memory and changes will not affect the file you loaded it from. You can however export the database after making changes.
You can also load remote files (using JS ajax, remote server must send Access-Control-Allow-Origin:*)
and prefill a SQL query using hash parameters:
- To load a remote SQLite file upon page load, append
#url=examples/Chinook_Sqlite.zipto the URL. Both absolute and relative URLs work. So do zipped files. - To prefill a SQL query, append
#sql=SELECT%20*%20FROM%20tableto the URL. - To load a remote file and prefill a query at the same time: Append both like this:
#url=examples/Chinook_Sqlite.zip&sql=SELECT%20*%20FROM%20table
Try this live example!
You can run and configure the SQLite Viewer inside a lightweight production container using Docker.
Execute the following build command in your workspace directory:
docker build -t sqlite-viewer -f docker/Dockerfile .To mount your local database file or ZIP archive and have the application automatically fetch and load it on page load:
docker run --rm -p 8080:80 \
-v "${PWD}/examples/Chinook_Sqlite.zip:/var/www/data.zip" \
sqlite-viewerNote: Navigate to http://localhost:8080 in your browser. The database tables will load instantly with zero user interaction.
You can specify a custom database URL and auto-execute a default SQL query on startup using environment variables:
docker run --rm -p 8080:80 \
-e DEFAULT_URL="examples/Chinook_Sqlite.zip" \
-e DEFAULT_SQL="SELECT name, type FROM sqlite_master WHERE type='table' ORDER BY name;" \
sqlite-viewerDEFAULT_URL: The database at this URL/path (relative path or absolute URL) will be fetched and opened on page load. Both raw databases and.ziparchives are supported.DEFAULT_SQL: The code editor will be pre-populated and this query will execute automatically on startup.
- Using the official sqlite3-wasm for parsing sqlite files.
- Can handle SQLite files in ZIP files, thanks to jszip.
- Enjoy query editing with SQL syntax highlighting thanks to CodeJar and PrismJS.
- Using jQuery 4.0 slim, Bootstrap 5.3.8, select2 and FileSaver.js.
Licensed under the Apache License, Version 2.0 — see LICENSE for details.
