Playcode Classic

Online SQL Compiler

Full PostgreSQL & SQLite in your browser. IndexedDB persistence, 18+ extensions including pgvector, database explorer, export/import. 100% local, no server needed.

Open Full Editor

Preview below · Full editor for saving & sharing

Loading PostgreSQL...
Files
main.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results
Database
No results yet Run a SELECT query to see results here
Console
PressCtrl+Enteror click Run to execute code

The Most Powerful Browser-Based SQL Compiler

Unlike typical online SQL tools, our SQL compiler runs full PostgreSQL directly in your browser via WebAssembly. Your data is persisted locally in IndexedDB: close the tab, come back later, your tables are still there. With 18+ PostgreSQL extensions including pgvector for AI, pg_trgm for fuzzy search, and uuid-ossp for UUIDs. No server, no signup, complete privacy.

How to Use This SQL Compiler

  1. Choose your engine: PostgreSQL (persistent) or SQLite (in-memory) via Templates
  2. Write SQL queries in the Monaco editor with syntax highlighting
  3. Press Ctrl+Enter for instant execution
  4. Explore tables in Database Explorer with pagination and row counts
  5. Export your database as SQL dump, or import existing dumps

Features

PostgreSQL + SQLite

Full PostgreSQL via PGlite or lightweight SQLite. Switch via templates.

Local Persistence

PostgreSQL data saved to IndexedDB. Close tab, come back, data's there.

18+ Extensions

pgvector, pg_trgm, hstore, uuid-ossp, ltree, cube, and more.

Database Explorer

Browse tables, preview data with pagination, view row counts.

Export & Import

pg_dump export, SQL import. Backup and restore your database.

100% Private

Everything runs in your browser. No data ever sent to servers.

SQL Query Examples

Basic SELECT
-- Select all artists from the database
SELECT * FROM artists LIMIT 10;
JOIN Query
-- Join albums with artists
SELECT
    albums.Title AS Album,
    artists.Name AS Artist
FROM albums
JOIN artists ON albums.ArtistId = artists.ArtistId
LIMIT 10;
Aggregate Functions
-- Count tracks per genre
SELECT
    genres.Name AS Genre,
    COUNT(*) AS TrackCount
FROM tracks
JOIN genres ON tracks.GenreId = genres.GenreId
GROUP BY genres.Name
ORDER BY TrackCount DESC;

Sample Databases Included

Chinook Database

Digital music store with artists, albums, tracks, customers, and invoices. Perfect for learning JOINs, aggregations, and subqueries.

artistsalbumstrackscustomersinvoicesgenres
Northwind Database

Classic e-commerce database with products, orders, customers, and employees. Great for business analytics queries.

productsorderscustomersemployeessupplierscategories

Why This SQL Compiler Is Different

Most online SQL tools are basic. Ours runs real PostgreSQL:

  • Persistent database: Your tables survive page refresh (IndexedDB)
  • Real PostgreSQL syntax: JSON operators, window functions, CTEs, arrays
  • pgvector for AI: Vector similarity search for embeddings
  • Full-text search: pg_trgm, unaccent, fuzzystrmatch
  • Export/Import: pg_dump your database, import SQL dumps
  • No rate limits: Run unlimited queries, it's all local

Part of Playcode Classic

Playcode began in 2016 as a browser coding environment. This compiler is one of its free code tools, which we now call Playcode Classic.

Playcode today is an AI platform for building and running websites and apps.