database

Execute Ruby scripts against event databases without starting a Rails server.

36|6|Updated Apr 6, 2022
One-click install
npx skills add https://github.com/rubys/showcase --skill database-rubys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/rubys/showcase/tree/main/.claude/skills/database
Command: npx skills add https://github.com/rubys/showcase --skill database-rubys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies database management for Rails applications, allowing you to easily run migrations, seed data, and execute custom Ruby scripts or queries against specific event databases without the overhead of a full Rails server. It streamlines development and maintenance tasks, saving you time and effort.

Core Features & Use Cases

  • Standard DB Commands: Provides quick access to essential Rails database commands like db:prepare, db:migrate, db:seed, and db:fixtures:load.
  • Offline Script Execution: The bin/run utility allows executing Ruby files or inline code against any database, including test databases, without starting a Rails console.
  • Data Query & Manipulation: Facilitates common database operations such as counting records, plucking attributes, and listing related data across different event databases.
  • Use Case: To quickly audit the number of heats in a specific event, use this skill to run bin/run db/2025-boston.sqlite3 -e "Heat.count", getting an immediate result without needing to start a Rails console or server.

Quick Start

Use the database skill to count the number of people in the test database.

Frequently Asked Questions about database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run database migrations and seed data in Rails without starting a server?

Use standard Rails database commands like `db:prepare`, `db:migrate`, and `db:seed` through this Skill to apply migrations and load seed data directly against your specified event database without server overhead.

Can I execute Ruby queries against a Rails database without opening the console?

Yes, use `bin/run` with your database file and inline code (`-e` flag) or script files to execute Ruby queries, counts, and data manipulation directly against any project database without starting Rails.

What's the best way to audit data in specific SQLite event databases?

Run targeted Ruby scripts via `bin/run` against specific `.sqlite3` files to count records, query attributes, and inspect related data across different event databases instantly.

Do I need a Rails server running to load fixtures into a test database?

No, use `db:fixtures:load` and `db:prepare` commands through this Skill to set up and populate test databases offline, without server startup.

How do I execute custom Ruby code against a specific database file?

Use `bin/run [database_path] -e "[code]"` to run inline Ruby or load a script file against any project database; set `RAILS_APP_DB` and `RAILS_STORAGE` environment variables to target the correct database.