From 2cee921f0d672c2a42523fccf0ed7da7871b7030 Mon Sep 17 00:00:00 2001 From: Faraz Noor Date: Wed, 8 Jan 2025 10:57:30 +0530 Subject: [PATCH] Add Support for ActiveRecord Proxy Adapters --- .github/workflows/test.yaml | 1 + CHANGELOG.md | 8 ++++++++ Rakefile | 1 + lib/activerecord-import/base.rb | 1 + lib/activerecord-import/version.rb | 2 +- test/adapters/postgresql_proxy_adapter.rb | 3 +++ 6 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/adapters/postgresql_proxy_adapter.rb diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cc09c55e..648d098e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -130,6 +130,7 @@ jobs: bundle exec rake test:postgis bundle exec rake test:postgresql bundle exec rake test:postgresql_makara + bundle exec rake test:postgresql_proxy_adapter - name: Run tests with seamless_database_pool run: | bundle exec rake test:seamless_database_pool diff --git a/CHANGELOG.md b/CHANGELOG.md index cd9d5743..0f453044 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## Changes in 2.1.0 +### New Features + +* Add Support for `active_record_proxy_adapters` gem. Since Rails 7.1 and above the support for + makara is gone. It is no longet maintained. Developers are left struggling. folks over at @nasdaq have written a gem called + [active_record_proxy_adapters](https://rubygems.org/gems/active_record_proxy_adapters) which + does the same thing. Since this gem has its own adapter called `postgresql_proxy` we need to add the same as per the discussions [here.](https://github.com/Nasdaq/active_record_proxy_adapters/issues/20) + ## Changes in 2.0.0 ### Breaking Changes diff --git a/Rakefile b/Rakefile index 4c5b5c99..d3ed6cca 100644 --- a/Rakefile +++ b/Rakefile @@ -24,6 +24,7 @@ ADAPTERS = %w( jdbcpostgresql postgresql postgresql_makara + postgresql_proxy_adapter postgis makara_postgis sqlite3 diff --git a/lib/activerecord-import/base.rb b/lib/activerecord-import/base.rb index 35c703ba..0ab76560 100644 --- a/lib/activerecord-import/base.rb +++ b/lib/activerecord-import/base.rb @@ -13,6 +13,7 @@ def self.base_adapter(adapter) when 'mysql2spatial' then 'mysql2' when 'spatialite' then 'sqlite3' when 'postgresql_makara' then 'postgresql' + when 'postgresql_proxy' then 'postgresql' when 'makara_postgis' then 'postgresql' when 'postgis' then 'postgresql' when 'cockroachdb' then 'postgresql' diff --git a/lib/activerecord-import/version.rb b/lib/activerecord-import/version.rb index 88fbf06e..9688fc6e 100644 --- a/lib/activerecord-import/version.rb +++ b/lib/activerecord-import/version.rb @@ -2,6 +2,6 @@ module ActiveRecord module Import - VERSION = "2.0.0" + VERSION = "2.1.0" end end diff --git a/test/adapters/postgresql_proxy_adapter.rb b/test/adapters/postgresql_proxy_adapter.rb new file mode 100644 index 00000000..02c375f2 --- /dev/null +++ b/test/adapters/postgresql_proxy_adapter.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +ENV["ARE_DB"] = "postgresql"