A modern, fast, and beautiful Web Database Studio for Rails development.
Inspired by Prisma Studio and Drizzle Studio.
intro.mp4
Rails Studio is packaged as a mountable Rails Engine with zero dependencies required by the host application (pre-compiled SPA bundled with the gem — no Node.js or NPM needed in your Rails app!).
Rails Studio was heavily inspired by the remarkable developer experience of two pioneering tools in the modern TypeScript & full-stack ecosystem:
- Prisma Studio — The visual, spreadsheet-like database browser for the Prisma ecosystem.
- Drizzle Studio — The lightning-fast, modern database studio for Drizzle ORM.
We wanted to bring that exact same fluid, intuitive, spreadsheet-like database exploration and editing experience to the Ruby on Rails and Active Record ecosystem — with zero configuration, packaged cleanly as a mountable Rails engine.
- 🚀 One-Line Integration: Mount directly inside your Rails
routes.rbunder development with zero configuration. - 📦 Zero-Dependency Delivery: Pre-compiled SPA bundled with the gem—no Node.js, Webpack, or asset pipeline setup required.
- 📊 Spreadsheet-like UX: Browse, filter, sort, and inline-edit records in an interactive table with column badges and sticky headers.
- 🔗 Association Navigation: Click foreign key badges to inspect and traverse referenced records in a side drawer.
- 💾 Git-like Staging: Review edited cells locally before committing multiple updates atomically in a single database transaction.
- ⚡ SQL Query Runner: Execute arbitrary SQL queries with query templates, execution timers, and CSV export.
- 💻 Embedded Rails Console: Run Ruby and Active Record code in an integrated browser terminal with auto-completion and SQL traces.
- ⌨️ Keyboard-First & Command Palette: Navigate tables and trigger actions rapidly via
Cmd+Kand built-in keyboard shortcuts. - 🎨 Dark & Light Modes: Seamless theme switching with automatic system detection and persistent user preferences.
- 🗄️ Database Agnostic: Works out of the box with PostgreSQL, MySQL, SQLite, Trilogy, and any adapter supported by Active Record.
- 🧩 Modern Rails Ready: Fully compatible with Rails 7.1+, 8.0+, composite primary keys, and multi-database architectures.
Rails Studio operates as a lightweight, self-contained Rails Engine:
- Mountable Engine: Plugs directly into your Rails application pipeline via
config/routes.rbwithout affecting your application logic. - Schema & Association Reflection: Dynamically introspects your Active Record models, column types, and relationships using your existing database connections.
- Pre-bundled SPA: Delivers a modern React frontend directly from the gem's static assets, requiring no JavaScript toolchain in your host app.
- Safe Transactions & In-Process Console: Communicates with internal engine API endpoints to stage edits, commit atomic transactions, and evaluate console commands safely within your Rails runtime.
Add to your Gemfile and mount the engine in config/routes.rb:
# Gemfile
group :development do
gem "rails_studio"
end
# config/routes.rb
Rails.application.routes.draw do
mount RailsStudio::Engine => "/rails_studio" if Rails.env.development?
endStart your server (bin/rails server) and visit http://localhost:3000/rails_studio.
You can customize Rails Studio by adding an initializer: config/initializers/rails_studio.rb:
RailsStudio.configure do |config|
# Allow access in production (Default: false, strongly recommended to keep false)
config.allow_in_production = false
# Read-only mode: prevents updates, creates, and deletes (Default: false)
config.read_only = false
# Default pagination records per page (Default: 50)
config.default_per_page = 50
# Maximum records allowed per page (Default: 200)
config.max_per_page = 200
# Tables excluded from sidebar and inspection
config.excluded_tables += %w[my_secret_table]
endWe use mise to manage development tasks:
mise run setup # Install dependencies, build assets & prepare test DB
mise run dev # Start Rails server with frontend build watch
mise run build # Compile frontend assets into public/assets/
mise run test # Run automated test suiteManual setup:
bundle install,pnpm --dir frontend install && pnpm --dir frontend build,cd test/dummy && bin/rails db:migrate db:seed, thenbin/rails server.
Maintainers: bump lib/rails_studio/version.rb, update CHANGELOG.md, run mise run build, then bundle exec rake release. See RELEASING.md.
The gem is available as open source under the terms of the MIT License.