Skip to content

Commit

Permalink
Set default_prepared_statements for trilogy
Browse files Browse the repository at this point in the history
Trilogy doesn't support prepared statements yet so until
trilogy-libraries/trilogy#3 is merged and support is
implemented in the adapter this should be set to false.

Fixes trilogy-libraries#5
  • Loading branch information
eileencodes committed Sep 22, 2022
1 parent 45ba3d7 commit 0e7e7c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/active_record/connection_adapters/trilogy_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ def translate_exception(exception, message:, sql:, binds:)
::TrilogyAdapter::LostConnectionExceptionTranslator.
new(exception, message, error_code).translate || super
end

def default_prepared_statements
false
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class ActiveRecord::ConnectionAdapters::TrilogyAdapterTest < TestCase
assert_match %(possible_keys), explain
end

test "#default_prepared_statements" do
assert_not_predicate @pool.connection, :prepared_statements?
end

test "#adapter_name answers name" do
assert_equal "Trilogy", @adapter.adapter_name
end
Expand Down

0 comments on commit 0e7e7c9

Please sign in to comment.