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) ⇒ Object
:nodoc:.
-
#select_all ⇒ Object
:nodoc:.
Instance Method Details
#exec_delete(sql, name = nil, binds = []) ⇒ Object Also known as: exec_update
:nodoc:
32 33 34 35 36 37 38 39 |
# File 'lib/active_record/connection_adapters/trilogy/database_statements.rb', line 32 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:
24 25 26 27 28 29 30 |
# File 'lib/active_record/connection_adapters/trilogy/database_statements.rb', line 24 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) raw_execute(to_sql(sql, binds), name) end |
#internal_exec_query(sql, name = "SQL", binds = [], prepare: false, async: false) ⇒ Object
:nodoc:
15 16 17 18 19 20 21 22 |
# File 'lib/active_record/connection_adapters/trilogy/database_statements.rb', line 15 def internal_exec_query(sql, name = "SQL", binds = [], prepare: false, async: false) # :nodoc: sql = transform_query(sql) check_if_write_query(sql) mark_transaction_written_if_write(sql) result = raw_execute(sql, name, async: async) ActiveRecord::Result.new(result.fields, result.to_a) end |
#select_all ⇒ Object
:nodoc:
7 8 9 10 11 12 13 |
# File 'lib/active_record/connection_adapters/trilogy/database_statements.rb', line 7 def select_all(*, **) # :nodoc: result = super with_raw_connection do |conn| conn.next_result while conn.more_results_exist? end result end |