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.
- 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
- Open a Rails project in VS Code
- The extension will automatically detect your
db/schema.rbfile - 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
- A Rails application with a
db/schema.rbfile - Visual Studio Code version 1.101.0 or higher
Ctrl+F(when focused on the schema view): Search for 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.
Use the search icon in the view title or press Ctrl+F when the view is focused to search for specific tables.
Click on any table in the tree view to jump directly to its definition in the schema.rb file.
This extension provides several configuration options to customize your experience:
-
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
- Show timestamp columns (
-
rails-schemas.showRailsTables(default:true)- Show Rails internal tables in the schema tree:
action_text_rich_textsactive_storage_attachmentsactive_storage_blobsactive_storage_variant_records
- Show Rails internal tables in the schema tree:
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.
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
If you encounter any issues or have feature requests, please file them on the GitHub Issues page.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to Gustavo Delgado for the inspiration and initial implementation of this extension.
Enjoy exploring your Rails database schema!
