Class: MiniSql::ActiveRecordPostgres::Connection
- Inherits:
-
Postgres::Connection
- Object
- Connection
- Postgres::Connection
- MiniSql::ActiveRecordPostgres::Connection
- Defined in:
- lib/mini_sql/active_record_postgres/connection.rb
Instance Attribute Summary collapse
-
#active_record_connection ⇒ Object
readonly
Returns the value of attribute active_record_connection.
Attributes inherited from Postgres::Connection
#deserializer_cache, #param_encoder, #type_map
Instance Method Summary collapse
-
#initialize(active_record_adapter, args = nil) ⇒ Connection
constructor
Initialize a new MiniSql::Postgres::Connection object.
-
#query_each(sql, *params) ⇒ Object
These two methods do not use ‘run`, so we need to apply the lock separately:.
- #query_each_hash(sql, *params) ⇒ Object
- #raw_connection ⇒ Object
Methods inherited from Postgres::Connection
default_deserializer_cache, #escape_string, #exec, #prepared, #query, #query_array, #query_decorator, #query_hash, #query_single, type_map, typemap
Methods inherited from Connection
#build, #escape_string, #exec, get, #query, #query_decorator, #query_hash, #query_single, #to_sql
Constructor Details
#initialize(active_record_adapter, args = nil) ⇒ Connection
Initialize a new MiniSql::Postgres::Connection object
13 14 15 16 |
# File 'lib/mini_sql/active_record_postgres/connection.rb', line 13 def initialize(active_record_adapter, args = nil) @active_record_connection = active_record_adapter super(nil, args) end |
Instance Attribute Details
#active_record_connection ⇒ Object (readonly)
Returns the value of attribute active_record_connection.
6 7 8 |
# File 'lib/mini_sql/active_record_postgres/connection.rb', line 6 def active_record_connection @active_record_connection end |
Instance Method Details
#query_each(sql, *params) ⇒ Object
These two methods do not use ‘run`, so we need to apply the lock separately:
24 25 26 |
# File 'lib/mini_sql/active_record_postgres/connection.rb', line 24 def query_each(sql, *params) with_lock { super } end |
#query_each_hash(sql, *params) ⇒ Object
27 28 29 |
# File 'lib/mini_sql/active_record_postgres/connection.rb', line 27 def query_each_hash(sql, *params) with_lock { super } end |
#raw_connection ⇒ Object
18 19 20 |
# File 'lib/mini_sql/active_record_postgres/connection.rb', line 18 def raw_connection active_record_connection.raw_connection end |