Class: ActiveRecord::ConnectionAdapters::FutureEnabledPostgreSQLAdapter
- Inherits:
-
PostgreSQLAdapter
- Object
- PostgreSQLAdapter
- ActiveRecord::ConnectionAdapters::FutureEnabledPostgreSQLAdapter
show all
- Includes:
- FutureEnabled
- Defined in:
- lib/active_record/connection_adapters/future_enabled_postgresql_adapter.rb
Instance Method Summary
collapse
#exec_query, #supports_futures?
Instance Method Details
#build_active_record_result(raw_result) ⇒ Object
54
55
56
57
58
59
|
# File 'lib/active_record/connection_adapters/future_enabled_postgresql_adapter.rb', line 54
def build_active_record_result(raw_result)
return if raw_result.nil?
result = ActiveRecord::Result.new(raw_result.fields, result_as_array(raw_result))
raw_result.clear
result
end
|
#future_execute(arels, binds, name) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/active_record/connection_adapters/future_enabled_postgresql_adapter.rb', line 30
def future_execute(arels, binds, name)
sql = arels.zip(binds).map { |arel, bind| to_sql(arel, bind.try(:dup)) }.join(';')
binds = binds.flatten(1).compact
log(sql, name, binds) do
if binds.empty?
@connection.get_last_result
@connection.send_query(sql)
@connection.block
@connection.get_result
else
@connection.get_last_result
@connection.send_query(sql, binds.map { |col, val|
type_cast(val, col)
})
@connection.block
@connection.get_result
end
end
end
|
#next_result ⇒ Object
61
62
63
|
# File 'lib/active_record/connection_adapters/future_enabled_postgresql_adapter.rb', line 61
def next_result
@connection.get_result
end
|