• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
originalleedunn

originalleedunn

sqliteExplorerReact

Remix of nbbaier/sqliteExplorerReact
Public
Like
sqliteExplorerReact
Home
Code
12
.claude
1
backend
2
frontend
5
shared
3
.gitignore
.vtignore
AGENTS.md
MIGRATION_GUIDE.md
README.md
biome.json
deno.json
deno.lock
Environment variables
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.http.ts
https://originalleedunn--019bb089eb4471eda8f9c902c786616d.web.val.run
README.md

SQLite Explorer (vReact)

Look ma, no HTMX!

A modern, web-based SQLite database browser and query tool built for Val Town. Execute SQL queries, browse database schema, and export results with a clean, intuitive interface.

Features

  • πŸ” Database Schema Browser - View all tables and views with visual icons
  • ✨ SQL Code Editor - Syntax highlighting with CodeMirror
  • ⚑ Query Execution - Execute SQL queries with real-time results
  • πŸ“Š Paginated Results - Handle large datasets (100 rows per page)
  • πŸ’Ύ Export Data - Download results as CSV or JSON
  • 🎨 Dark Mode - Automatic theme switching with warm color palette
  • πŸ’¬ Query Persistence - Saves queries per table in localStorage
  • ⌨️ Keyboard Shortcuts - Cmd/Ctrl+Enter to run queries
  • πŸ”’ OAuth Authentication - Secure Val Town authentication
  • πŸ›‘οΈ Error Boundaries - Graceful error handling and recovery

Tech Stack

Frontend

  • React 18.2.0 - UI framework
  • CodeMirror 6 - SQL editor with syntax highlighting
  • TailwindCSS - Styling (via Play CDN)
  • TypeScript - Type safety with strict mode

Backend

  • Hono 4 - Lightweight web framework
  • Turso/libSQL - SQLite database (via Val Town)
  • Deno - Runtime environment

Tools

  • Biome - Linting and formatting
  • TypeScript Strict Mode - Enhanced type safety

Project Structure

.
β”œβ”€β”€ backend/
β”‚   └── index.http.ts                 # Hono API server / Entry Point
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ AppHeader.tsx             # App header with title
β”‚   β”‚   β”œβ”€β”€ EditorSection.tsx         # SQL editor with controls
β”‚   β”‚   β”œβ”€β”€ ErrorBoundary.tsx         # Error boundary component
β”‚   β”‚   β”œβ”€β”€ Icons.tsx                 # Icon components
β”‚   β”‚   β”œβ”€β”€ PaginationBar.tsx         # Pagination controls
β”‚   β”‚   β”œβ”€β”€ Table.tsx                 # Data table with pagination
β”‚   β”‚   β”œβ”€β”€ TablesList.tsx            # Schema sidebar
β”‚   β”‚   └── ThemeToggle.tsx           # Dark mode toggle
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useCodeEditor.ts          # Editor state management
β”‚   β”‚   β”œβ”€β”€ useDownload.ts            # Export functionality
β”‚   β”‚   β”œβ”€β”€ useQueryExecution.ts      # Query execution logic
β”‚   β”‚   └── useTableSelection.ts      # Table selection logic
β”‚   β”œβ”€β”€ App.tsx                       # Main React application
β”‚   β”œβ”€β”€ index.html                    # HTML entry point
β”‚   └── main.tsx                      # React entry point
└── shared/
    β”œβ”€β”€ exportHelpers.ts              # CSV/JSON export utilities
    β”œβ”€β”€ sqlHelpers.ts                 # SQL parsing utilities
    └── types.ts                      # Shared TypeScript types

Usage

Running Queries

  1. Select a table from the sidebar to auto-populate the editor with SELECT * FROM [table]
  2. Write or edit your SQL query in the editor
  3. Press Cmd/Ctrl+Enter or click the "Run Query" button
  4. View results in the paginated table below

Multi-Statement Queries

The editor supports multiple SQL statements. It will execute the statement at your cursor position when you press Cmd/Ctrl+Enter.

Exporting Data

  1. Execute a query to get results
  2. Click "Download CSV" or "Download JSON"
  3. File downloads automatically with the results

Keyboard Shortcuts

  • Cmd/Ctrl+Enter - Execute query at cursor
  • Click table name - Auto-populate SELECT query

API Endpoints

GET /api/schema

Returns all tables and views in the database.

Response:

{ "tables": [{ "name": "users", "type": "table" }], "views": [{ "name": "active_users", "type": "view" }] }

POST /api/query

Executes a SQL query.

Request:

{ "query": "SELECT * FROM users LIMIT 10" }

Response:

{ "success": true, "data": { "columns": ["id", "name", "email"], "rows": [[1, "Alice", "alice@example.com"]] } }

GET /api/download/csv?query=<sql>

Downloads query results as CSV.

GET /api/download/json?query=<sql>

Downloads query results as JSON.

Limitations

  • Admin tool only - Not designed for public-facing applications
  • Single database - Works with Val Town's SQLite instance
  • No query history - Future enhancement planned
  • 100 row pagination - Configurable in Table.tsx

Migration History

This project was migrated from HTMX to React on November 14, 2024. See MIGRATION_GUIDE.md for details on the migration process.

Code
.claudebackendfrontendshared.gitignore.vtignoreAGENTS.mdMIGRATION_GUIDE.mdREADME.mdbiome.jsondeno.jsondeno.lock
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.