Gist 5550734
✓ Published0🌍 Public
Aafbroman
Last edited Nov 15, 2011
Created on May 9, 2013
This example demonstrates a Ruby on Rails configuration that enables MySQL2 database connections to support multiple statements and the FOUND_ROWS flag. It shows how to override ActiveRecord’s default connection method by defining a custom `mysql2_connection` class method that sets the `Mysql2::Client::MULTI_STATEMENTS` and `Mysql2::Client::FOUND_ROWS` flags. The code initializes a `Mysql2::Client` instance with symbolized configuration keys and passes the connection options to a new `ConnectionAdapters::Mysql2Adapter`. It relies on the `Mysql2` gem and ActiveRecord’s adapter API to handle the database connection setup.
AI-generated description