ActiveRecord host pooling
This gem allows for one ActiveRecord connection to be used to connect to multiple databases on a server. It accomplishes this by calling select_db() as necessary to switch databases between database calls.
For now, the only backend known to work is MySQL, with the mysql2 gem. Postgres, from an informal reading of the docs, will never support the concept of one server connection sharing multiple dbs.
$ gem install active_record_host_pool
and make sure to require 'active_record_host_pool' in some way.
You need a local user called 'john-doe'.
mysql -uroot CREATE USER 'john-doe'@'localhost'; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX ON *.* TO 'john-doe'@'localhost'; FLUSH PRIVILEGES;
With mysql running locally, run
BUNDLE_GEMFILE=gemfiles/rails5.2.gemfile bundle exec rake test
BUNDLE_GEMFILE=gemfiles/rails5.2.gemfile ruby test/test_arhp.rb --seed 19911 --verbose
Copyright (c) 2011 Zendesk. See MIT-LICENSE for details.