Registry / database / bun-sql-studio

bun-sql-studio

JSON →
library1.0.3jsnpmunverified

A zero-config, visual SQL database studio for Bun that supports SQLite, PostgreSQL, and MySQL. Version 1.0.3 is the current stable release. Unlike heavy GUI tools (DataGrip, TablePlus) or CLI-based alternatives, Bun SQL Studio requires only Bun runtime—no Python, Java, or system database binaries. It auto-detects Drizzle configs, provides a visual table browser, SQL query editor with paginated results, JSON viewer, and cross-database support. Released as a single-binary tool with no hidden dependencies.

npm install bun-sql-studio
INSTALL
IMPORT
SIG · BUN-SQL-STUDIO
B
bun-sql-studio
databasejavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

runStudio
import { runStudio } from 'bun-sql-studio'
const { runStudio } = require('bun-sql-studio')
ESM only; package does not export CommonJS
default (studio server)
import bunSqlStudio from 'bun-sql-studio'
import { default as bunSqlStudio } from 'bun-sql-studio'
Default export is the async function to start the server
type StudioConfig
import type { StudioConfig } from 'bun-sql-studio/types'
import { StudioConfig } from 'bun-sql-studio'
TypeScript users should import types from the types subpath to avoid runtime bundling

Shows config file and programmatic usage with environment variable support for credentials.

// 1. Create bun-sql-studio.json in project root // { // "dialect": "sqlite", // "dbUrl": "./database.sqlite", // "port": 4987 // } // 2. Run via bunx (no install needed) // bunx bun-sql-studio // Or programmatically (if installed) import bunSqlStudio from 'bun-sql-studio'; await bunSqlStudio({ dialect: 'sqlite', dbUrl: process.env.DB_URL ?? './database.sqlite', port: Number(process.env.PORT) || 4987, }); console.log('Studio running at http://localhost:4987');
Debug
Known issues
gotchaPackage requires Bun runtime (v1.3.4+); does not work with Node.js or Deno.
fix
Install Bun from https://bun.sh and run with bun, not node.
affects: >=1.0
breakingConfiguration file must be named exactly 'bun-sql-studio.json' in the project root; other names are ignored.
fix
Rename your config file to match the expected name, or pass config programmatically.
affects: >=1.0
gotchaPort 4987 is hardcoded default; if another process uses it, the studio will fail to start.
fix
Specify an alternative port in the config file or via programmatic options.
affects: >=1.0
deprecatedDirect require() pattern (CommonJS) is not supported; the package is ESM-only.
fix
Use import syntax or set "type": "module" in your package.json.
affects: >=1.0
gotchaFor PostgreSQL and MySQL, the connection string must include credentials; they cannot be read from environment variables by default.
fix
Use environment variables inside the config file or pass them programmatically.
affects: >=1.0
breakingThe package exports a default function, not a class; attempting to new bunSqlStudio() will throw.
fix
Call bunSqlStudio() directly without new.
affects: >=1.0
Errors
Common errors & fixes
error: Cannot find module 'bun-sql-studio'
Package not installed or Bun not used as runtime.
fix
Run 'bun add bun-sql-studio' or use 'bunx bun-sql-studio' without installing.
Error: Config file 'bun-sql-studio.json' not found in current or parent directories
The config file is missing or misnamed.
fix
Create a 'bun-sql-studio.json' file in the project root, or pass config programmatically.
TypeError: bunSqlStudio is not a function
CommonJS require() used instead of import.
fix
Use 'import bunSqlStudio from 'bun-sql-studio'' (ESM).
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
bunrequiredThe only runtime required; no Node.js, Python, or Java needed
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources