From 8efe8dc16e5efb1b4afcc5f2ffbee12beaf4b22b Mon Sep 17 00:00:00 2001 From: Brian Hawley Date: Thu, 7 Sep 2023 08:41:41 -0700 Subject: [PATCH] Fix merge conflict between #48 and #51 Both #48 and #51 added `write_query?` and `explain`. I removed the duplicate methods that weren't being used, which were the older versions with no options parameter. The newer `write_query?` and `explain` with the options are still there. --- .../trilogy/database_statements.rb | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/active_record/connection_adapters/trilogy/database_statements.rb b/lib/active_record/connection_adapters/trilogy/database_statements.rb index e3d48b1..452415e 100644 --- a/lib/active_record/connection_adapters/trilogy/database_statements.rb +++ b/lib/active_record/connection_adapters/trilogy/database_statements.rb @@ -21,21 +21,6 @@ def execute(sql, name = nil, **kwargs) ActiveRecord::Result.new(result.fields, result.to_a) end - def write_query?(sql) # :nodoc: - !READ_QUERY.match?(sql) - rescue ArgumentError # Invalid encoding - !READ_QUERY.match?(sql.b) - end - - def explain(arel, binds = []) - sql = "EXPLAIN #{to_sql(arel, binds)}" - start = Process.clock_gettime(Process::CLOCK_MONOTONIC) - result = internal_exec_query(sql, "EXPLAIN", binds) - elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start - - MySQL::ExplainPrettyPrinter.new.pp(result, elapsed) - end - def select_all(*, **) # :nodoc: result = super with_trilogy_connection do |conn|