db-studio

FAQ

Answers about connection safety, anonymous usage data and how to opt out, the AI assistant, Prisma and Drizzle projects, multiple databases, and fixing connection problems.

db-studio runs on your computer and connects to your database directly. Your connection string is never sent anywhere or stored by us.

Two things do leave your machine:

All the code is open source, so you can check for yourself: github.com/husamql3/db-studio

db-studio sends anonymous usage and reliability data: which features you use, the database engine, response times, and errors with sensitive details removed. Queries, schemas, table and column names, and values are never collected.

To opt out, set DB_STUDIO_TELEMETRY=0 when you start db-studio:

DB_STUDIO_TELEMETRY=0 npx db-studio

Browsers that send a Global Privacy Control signal are opted out automatically.

Yes! Just run npx db-studio in your Prisma project folder. It will automatically use your existing DATABASE_URL from .env.

Yes! Run npx db-studio in your Drizzle project folder. It uses the same DATABASE_URL from your .env file. No extra setup needed.

Yes. You can switch connections in one db-studio instance:

  1. Click the current connection name in the sidebar footer.
  2. Select a saved connection under Switch connection.
  3. To add a connection or see all saved connections, choose All connections…. Select a saved connection, or paste a connection URL and click Connect.

Every connection you open is saved automatically. On the Connect page, you can filter, rename, color, or delete saved connections. See Saved connections.

To switch databases on the same server, use the database selector in the sidebar footer.

To keep different connections open at the same time, run separate instances in different terminals with different ports and env files:

# Dev database (terminal 1)
npx db-studio --env .env.dev --port 3333

# Production database (terminal 2)
npx db-studio --env .env.prod --port 3334

Or use direct connection strings:

npx db-studio --database-url postgresql://localhost:5432/devdb --port 3333

First, check if your connection works:

npx db-studio --status

Common problems and fixes:

  • No .env file found - Make sure .env exists in your current folder or a parent folder
  • Wrong URL format - Should be: postgresql://user:pass@host:port/dbname
  • Database not running - Check if your database server is started
  • Network blocked - Check firewall or network settings

Use a different port:

npx db-studio --port 4000
# or
npx db-studio --port 8080

db-studio looks for .env in:

  1. Your current folder
  2. Parent folders (it searches upward)

You can also:

  • Specify a file: npx db-studio --env .env.local
  • Use a different variable: npx db-studio --var-name MY_DB_URL
  • Skip the file entirely: npx db-studio --database-url "postgresql://..."

You can, but we recommend using db-studio only for:

  • Local development
  • Staging environments
  • Debugging

If you use it with production databases:

  • Never expose the web interface to the public internet
  • Use SSH tunnels or VPN to connect
  • Use strong passwords and limited database permissions
  • Treat it like an admin tool, not a public app

The AI assistant answers questions about your data in plain English. In the query editor it can also generate a query, optimize one, or suggest a fix for a failed one.

  • It uses your table structure to understand your database. You can turn schema sharing off in Settings.
  • Without a key, it uses our hosted Gemini model, limited to 3 messages per day.
  • Add your own key for Gemini, OpenAI, Anthropic, Grok, or OpenRouter in Settings to raise the limit to 120 messages per day.

Yes! You can:

Export data:

  • CSV format
  • JSON format
  • Excel files

Import data:

  • Upload CSV files
  • Upload JSON files
  • Upload Excel files

Use the table menu to access these features.

Need More Help?

Have a question? Found a bug? Want a new feature?

Open an issue on GitHub