Description
SecondBase is a Ruby gem that adds a second database to a Rails application. You describe the second database in your database.yml under a secondbase key, and the gem extends the ActiveRecord tasks so that creating, migrating and testing your databases also covers the second one. By default it runs a mirrored db:second_base task alongside each matching base database task, and one configuration setting turns that off. The project was built for Rails applications before version 6. The README now says it is deprecated for Rails 6 and later, because Rails 6.0 added built-in support for multiple databases as a core feature. The maintainers recommend Rails' own multiple database support for current versions. They note that Rails 5.x or earlier users may still find SecondBase useful. The source is public on GitHub under the customink organization, with usage notes, advanced usage and contributing guidelines in the README.…
Highlights
- Adds a second database to a Rails app through database.yml
- Runs mirrored db:second_base tasks next to the base database tasks
- Can be switched off with one configuration setting
- Deprecated for Rails 6 and later, which have native multiple database support
Ratings & Reviews
No ratings yet
Be the first to rate Secondbase.
People also visit
StackRender
Database schema design and SQL migration generator supporting PostgreSQL, MySQL
Secondbase FAQ
What does SecondBase do?
It lets a Rails application use a second database. You configure it in database.yml under a secondbase key, and it extends the Active Record tasks so the second database is created, migrated and prepared along with the base one.
Should I use SecondBase in a new project?
No. The README says it is deprecated for Rails 6 and higher, which include built-in multiple database support. It points to the Rails guides on multiple databases for current versions.
Which Rails versions is it for?
The README says it was built for Rails applications before 6.0. It notes that Rails 5.x or earlier users may still find it useful, and it encourages upgrading to a version with native support.
Can I turn off the mirrored tasks?
Yes. Set config.second_base.run_with_db_tasks to false in your application configuration, and the base database tasks will no longer run the second database tasks.
Where is the source code?
It is public in the customink/secondbase repository on GitHub, which also includes the README with usage notes and contributing guidelines.
What are the best Secondbase alternatives?
Popular alternatives to Secondbase include undb, StackRender and Velld. See all Secondbase alternatives




.jpg?auto=compress&fit=max&w=128)



