Class: ActiveRecord::ConnectionAdapters::DuckdbRailtie
- Inherits:
-
Rails::Railtie
- Object
- Rails::Railtie
- ActiveRecord::ConnectionAdapters::DuckdbRailtie
- Defined in:
- lib/activerecord-duckdb.rb
Overview
Rails integration for the DuckDB adapter Provides rake tasks and ActiveRecord integration when Rails is present
Instance Method Summary collapse
-
#active_record ⇒ void
Sets up DuckDB adapter integration when ActiveRecord loads.
Instance Method Details
#active_record ⇒ void
This method returns an undefined value.
Sets up DuckDB adapter integration when ActiveRecord loads
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/activerecord-duckdb.rb', line 33 ActiveSupport.on_load(:active_record) do # Register the database tasks - try multiple approaches for compatibility if ActiveRecord::Tasks::DatabaseTasks.respond_to?(:register_task) ActiveRecord::Tasks::DatabaseTasks.register_task( 'duckdb', 'ActiveRecord::Tasks::DuckdbDatabaseTasks' ) else # Fallback for older Rails versions ActiveRecord::Tasks::DatabaseTasks.module_eval do def self.class_for_adapter(adapter) case adapter when 'duckdb' ActiveRecord::Tasks::DuckdbDatabaseTasks else super end end end end end |