Rails Schema Explorer

A Visual Studio Code extension that provides an intuitive way to explore and navigate Rails database schema files. This extension adds a dedicated view in the sidebar to display your Rails application's database tables and their structure, making it easier to understand and work with your database schema.
Features
- Schema Tree View: Display all database tables from your Rails schema file in a convenient tree structure
- Real-time Updates: Automatically refresh the schema view when your schema files change
- Quick Navigation: Jump directly to table definitions in your schema file
- Search Functionality: Find tables quickly with the built-in search feature
- Multi-workspace Support: Works with multiple Rails projects open simultaneously

Getting Started
- Open a Rails project in VS Code
- The extension will automatically detect your
db/schema.rb file
- Click on the Rails DB Schema icon in the activity bar to view your database tables
- Use the search functionality to quickly find specific tables
- Click on any table to navigate to its definition in the schema file
Requirements
- A Rails application with a
db/schema.rb file
- Visual Studio Code version 1.101.0 or higher
Keyboard Shortcuts
Ctrl+F (when focused on the schema view): Search for tables
Usage
Viewing Database Tables
Once installed, the extension will automatically scan your Rails project for schema files. The database tables will appear in the Rails DB Schema view in the sidebar.
Searching Tables
Use the search icon in the view title or press Ctrl+F when the view is focused to search for specific tables.
Navigating to Schema Definitions
Click on any table in the tree view to jump directly to its definition in the schema.rb file.
Configuration
This extension provides several configuration options to customize your experience:
Available Settings
rails-schemas.autoReveal (default: true)
- Automatically reveal the table in the schema explorer when opening a Rails model file
rails-schemas.showIndexes (default: true)
- Show database indexes in the schema tree
rails-schemas.showTimestamps (default: true)
- Show timestamp columns (
created_at, updated_at) in the schema tree
rails-schemas.showRailsTables (default: true)
- Show Rails internal tables in the schema tree:
action_text_rich_texts
active_storage_attachments
active_storage_blobs
active_storage_variant_records
Example Configuration
Add these settings to your VS Code settings (File > Preferences > Settings or settings.json):
{
"rails-schemas.autoReveal": true,
"rails-schemas.showIndexes": true,
"rails-schemas.showTimestamps": false,
"rails-schemas.showRailsTables": false
}
This extension works out of the box with standard Rails applications. It automatically detects schema files matching the pattern **/db/*schema.rb.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature)
- Commit your changes (
git commit -m 'Add some AmazingFeature')
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
Issues
If you encounter any issues or have feature requests, please file them on the GitHub Issues page.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Thanks
Special thanks to Gustavo Delgado for the inspiration and initial implementation of this extension.
Enjoy exploring your Rails database schema!