Skip to content

Commit 173c228

Browse files
Keep using log in DatabaseStatements#raw_execute
The payload construction was moved here in a previous commit, but log wasn't removed or deprecated. We've been using this as a hook we can override to add some adapter specific-keys. If we want to remove or bypass this at a later date we should probably introduce something that can be overridden like we did for cache_notification_info. Co-authored-by: Daniel Colson <[email protected]>
1 parent e4f67a6 commit 173c228

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -546,23 +546,10 @@ def internal_exec_query(...) # :nodoc:
546546
# Lowest level way to execute a query. Doesn't check for illegal writes, doesn't annotate queries, yields a native result object.
547547
def raw_execute(sql, name = nil, binds = [], prepare: false, async: false, allow_retry: false, materialize_transactions: true)
548548
type_casted_binds = type_casted_binds(binds)
549-
notification_payload = {
550-
sql: sql,
551-
name: name,
552-
binds: binds,
553-
type_casted_binds: type_casted_binds,
554-
async: async,
555-
connection: self,
556-
transaction: current_transaction.user_transaction.presence,
557-
statement_name: nil,
558-
row_count: 0,
559-
}
560-
@instrumenter.instrument("sql.active_record", notification_payload) do
549+
log(sql, name, binds, type_casted_binds, async: async) do |notification_payload|
561550
with_raw_connection(allow_retry: allow_retry, materialize_transactions: materialize_transactions) do |conn|
562551
perform_query(conn, sql, binds, type_casted_binds, prepare: prepare, notification_payload: notification_payload)
563552
end
564-
rescue ActiveRecord::StatementInvalid => ex
565-
raise ex.set_query(sql, binds)
566553
end
567554
end
568555

0 commit comments

Comments
 (0)