A Sequel database extension that reuses an existing Active Record connection, enabling seamless interoperability between the two ORMs.
sequel-activerecord_connection is a Ruby gem that extends Sequel to reuse an existing Active Record database connection. It solves the problem of maintaining separate connections when using both ORMs, ensuring transactional consistency and avoiding extra database overhead. This is particularly useful for integrating Sequel-based libraries or transitioning from Active Record to Sequel.
Ruby developers working with Rails or other Active Record-based applications who want to use Sequel for specific queries, integrate Sequel-based libraries like Rodauth, or gradually migrate from Active Record to Sequel.
Developers choose this gem because it eliminates transactional inconsistencies between Sequel and Active Record, reduces database connection overhead, and provides a seamless way to leverage Sequel's advanced query capabilities within an Active Record application without configuration headaches.
Allows Sequel to reuse Active Record's database connection
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Reuses Active Record's existing database connection, eliminating the overhead of maintaining separate connections and reducing server load, as highlighted in the README's explanation of avoiding extra connections.
Keeps Sequel and Active Record transaction states in sync, enabling nested transactions and ensuring operations in one ORM are reflected in the other, which is crucial for transactional consistency.
Supports PostgreSQL, MySQL, SQLite, SQL Server, and Oracle adapters, including native and JDBC versions for JRuby, making it versatile for various database setups.
Simple setup by loading the extension on a Sequel database object with minimal configuration, allowing quick adoption in Rails applications without major changes.
Transaction hooks can behave differently depending on whether Sequel or Active Record manages the transaction, leading to potential bugs in complex nested scenarios, as detailed in the README's transaction examples.
Requires the after_commit_everywhere gem for Active Record 7.1 or older, adding an extra dependency that must be managed and potentially complicating upgrades.
Only explicitly tested adapters are guaranteed to work; untested or custom adapters might have integration issues, restricting use in some environments.