Module: ActiveRecord::ConnectionAdapters::Trilogy::DatabaseStatements
- Included in:
- ActiveRecord::ConnectionAdapters::TrilogyAdapter
- Defined in:
- lib/active_record/connection_adapters/trilogy/database_statements.rb
Instance Method Summary collapse
-
#exec_delete(sql, name = nil, binds = []) ⇒ Object
(also: #exec_update)
:nodoc:.
-
#exec_insert(sql, name, binds, pk = nil, sequence_name = nil, returning: nil) ⇒ Object
:nodoc:.
-
#internal_exec_query(sql, name = "SQL", binds = [], prepare: false, async: false, allow_retry: false) ⇒ Object
:nodoc:.
Instance Method Details
#exec_delete(sql, name = nil, binds = []) ⇒ Object Also known as: exec_update
:nodoc:
25 26 27 28 29 30 31 32 |
# File 'lib/active_record/connection_adapters/trilogy/database_statements.rb', line 25 def exec_delete(sql, name = nil, binds = []) # :nodoc: sql = transform_query(sql) check_if_write_query(sql) mark_transaction_written_if_write(sql) result = raw_execute(to_sql(sql, binds), name) result.affected_rows end |
#exec_insert(sql, name, binds, pk = nil, sequence_name = nil, returning: nil) ⇒ Object
:nodoc:
16 17 18 19 20 21 22 23 |
# File 'lib/active_record/connection_adapters/trilogy/database_statements.rb', line 16 def exec_insert(sql, name, binds, pk = nil, sequence_name = nil, returning: nil) # :nodoc: sql = transform_query(sql) check_if_write_query(sql) mark_transaction_written_if_write(sql) sql, _binds = sql_for_insert(sql, pk, binds, returning) raw_execute(sql, name) end |
#internal_exec_query(sql, name = "SQL", binds = [], prepare: false, async: false, allow_retry: false) ⇒ Object
:nodoc:
7 8 9 10 11 12 13 14 |
# File 'lib/active_record/connection_adapters/trilogy/database_statements.rb', line 7 def internal_exec_query(sql, name = "SQL", binds = [], prepare: false, async: false, allow_retry: false) # :nodoc: sql = transform_query(sql) check_if_write_query(sql) mark_transaction_written_if_write(sql) result = raw_execute(sql, name, async: async, allow_retry: allow_retry) ActiveRecord::Result.new(result.fields, result.to_a) end |