Claude Code for Beekeeper Studio — Workflow Guide

Written by Michael Lip · Solo founder of Zovo · $400K+ on Upwork · 100% JSS Join 50+ builders · More at zovo.one

The Setup

You are using Beekeeper Studio as your SQL database GUI — an open-source, cross-platform database manager that supports PostgreSQL, MySQL, SQLite, SQL Server, and more. Beekeeper Studio provides a clean interface for writing queries, browsing tables, and managing connections. Claude Code can generate SQL queries and manage schemas, but it assumes you are using command-line tools or pgAdmin.

What Claude Code Gets Wrong By Default

  1. Generates psql command-line instructions. Claude writes psql -h localhost -U postgres -d mydb for database interaction. With Beekeeper Studio, you connect through the GUI and run queries in the editor — no command-line psql needed.

  2. Creates migration files without considering Beekeeper Studio’s workflow. Claude generates migration scripts that you run from the terminal. Beekeeper Studio can execute SQL files directly — paste the migration SQL into a query tab and run it.

  3. Ignores saved queries and query history. Claude tells you to save SQL queries as .sql files. Beekeeper Studio has built-in saved queries and query history — you can organize frequently-used queries within the app.

  4. Outputs results in terminal format. Claude formats query results as ASCII tables for terminal display. Beekeeper Studio displays results in a sortable, filterable grid with export options — formatting for terminal output is unnecessary.

The CLAUDE.md Configuration

# Beekeeper Studio Database Project

## Database
- GUI: Beekeeper Studio (open-source SQL editor)
- Databases: PostgreSQL, MySQL, SQLite, SQL Server
- Connections: Managed in Beekeeper Studio connection manager
- Queries: Written and executed in Beekeeper Studio query tabs

## Beekeeper Studio Rules
- Generate SQL queries (not psql/mysql CLI commands)
- Migrations: provide SQL that can be pasted into query tab
- Use standard SQL syntax for portability
- Format queries for readability (Beekeeper auto-formats)
- Include comments in complex queries for saved query context
- Connection details managed in Beekeeper, not in .env files

## Conventions
- Schema changes: provide ALTER/CREATE TABLE SQL
- Data inspection: SELECT queries with LIMIT for large tables
- Exports: Beekeeper handles CSV/JSON export from results
- Use transactions for multi-statement migrations
- Test queries with EXPLAIN before running on production
- Saved queries for recurring operations

Workflow Example

You want to debug a slow query on your PostgreSQL database. Prompt Claude Code:

“Write a query to find all orders from the last 30 days joined with customers and products, including the EXPLAIN ANALYZE prefix so I can check the query plan in Beekeeper Studio. Add indexes if the join performance is poor.”

Claude Code should generate a SELECT query with proper joins and a WHERE clause for the date filter, prepend EXPLAIN ANALYZE for performance analysis, and suggest CREATE INDEX statements for any columns used in joins or filters that might benefit from indexing.

Common Pitfalls

  1. Connection string in code vs. Beekeeper Studio. Claude puts database connection strings in application .env files and also tells you to connect via Beekeeper. Keep connection config separate — your app uses .env, Beekeeper Studio uses its own connection manager.

  2. Running destructive queries without transactions. Claude generates DROP TABLE or DELETE FROM without wrapping in a transaction. In Beekeeper Studio, use BEGIN; ... ROLLBACK; first to preview changes, then BEGIN; ... COMMIT; to apply.

  3. Assuming table structure without checking. Claude writes queries referencing columns that may not exist. In Beekeeper Studio, browse the table structure first to confirm column names and types before writing complex queries.