Run PostgreSQL and SQLite directly in your browser with full SQL support and persistent storage. No server setup required.
SQL Notebook is a web-based platform that enables you to run fully-featured PostgreSQL and SQLite instances directly in the browser. Powered by PGLite and wa-sqlite, you can execute complex queries, manage multiple databases, and even persist your data across sessions—no backend server or deployment hassles required.
Live Demo: https://sql--notebook.vercel.app/
Demo Video: https://youtu.be/z0T4EDMFEvo
SQL Notebook was created to provide a simple, intuitive, and flexible environment for developers, data analysts, and SQL enthusiasts who want to:
- Experiment with SQL without having to spin up a local or remote database server.
- Learn SQL in a familiar browser-based environment.
- Prototype quickly and share snippets without complex setup.
- Retain data locally in the browser for future sessions.
By leveraging IndexedDB and advanced browser technologies, SQL Notebook preserves your data and configurations across page reloads, giving you a persistent, server-free database environment at your fingertips.
-
Local Database Instance
Run fully-featured PostgreSQL and SQLite instances directly in your browser—completely serverless. Harness the power of PGLite and wa-sqlite. -
Full SQL Support
Execute all standard SQL queries with complete compatibility, including joins, transactions, subqueries, and more. -
Persistent Storage
Store your data in the browser using IndexedDB. Your databases remain intact even if you close or refresh your browser. -
Rich Code Editor
Enjoy a feature-packed editor courtesy of CodeMirror. Benefit from syntax highlighting, auto-completion, and more advanced editing features. -
Multiple Notebooks
Create and manage multiple notebooks within the app, making it easy to segment your experiments or projects. -
Lightweight & Fast
Deployed on Vercel for quick load times and reliable hosting.
- Frontend Framework: Svelte & SvelteKit
- Styling: Tailwind CSS & shadcn-svelte
- Deployments: Vercel
- Databases: PGLite & wa-sqlite
- Editor: CodeMirror
- Browser Storage: IndexedDB via Dexie
-
Clone the Repository
git clone https://github.com/ShawnGeorge03/SQL-Notebook.git
-
Navigate to the project directory
cd SQL-Notebook
-
Install the dependencies
pnpm install
-
Start the development server
pnpm run dev
Open the browser and navigate to http://localhost:5173.
-
Open a New Notebook
- Click on the “New Notebook” button in the UI to create a new workspace.
-
Write SQL Queries
-
In the editor window, input your SQL queries.
-
Example:
CREATE TABLE users ( id SERIAL PRIMARY KEY, name TEXT NOT NULL, email TEXT NOT NULL UNIQUE ); INSERT INTO users (name, email) VALUES ('Jane Doe', 'jane@example.com'); SELECT * FROM users;
-
-
Execute
- Click on the “Run” button (or use the provided shortcut) to execute the current query.
-
Review Results
- The results pane below the editor will display the output from your query, including errors if any.
-
Persistence
- Data is automatically stored in your browser’s IndexedDB, so your tables and records will remain accessible on future visits.
-
Manage Multiple Notebooks
- Switch between notebooks for different projects or ideas without mixing up your data. All notebooks are stored separately in IndexedDB.
To build the project for production:
pnpm run build
To preview the production build, run:
pnpm run preview
This project is licensed under The Unlicense.
You are free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
For more information, see the LICENSE file.
This project uses third-party libraries that are licensed under their respective terms. See the NOTICE file for details. Run pnpm run licenses ls
to generate a list of dependencies and their licenses.
Interested in contributing? Feel free to open an issue or pull request!
Happy Querying! 🚀
We hope SQL Notebook helps simplify your data exploration and SQL development. If you have feedback or suggestions, please create an issue or submit a pull request.