Class: Syntropy::DB::Store
- Inherits:
-
Object
- Object
- Syntropy::DB::Store
- Defined in:
- lib/syntropy/db/store.rb
Instance Method Summary collapse
- #execute(sql) ⇒ Object
-
#initialize(connection_pool) ⇒ Store
constructor
A new instance of Store.
- #query(sql) ⇒ Object
- #query_single_row(sql) ⇒ Object
- #query_single_value(sql) ⇒ Object
- #transaction ⇒ Object
Constructor Details
#initialize(connection_pool) ⇒ Store
Returns a new instance of Store.
6 7 8 |
# File 'lib/syntropy/db/store.rb', line 6 def initialize(connection_pool) @connection_pool = connection_pool end |
Instance Method Details
#execute(sql) ⇒ Object
22 23 24 |
# File 'lib/syntropy/db/store.rb', line 22 def execute(sql, *, **) @connection_pool.with_db { it.execute(sql, *, **) } end |
#query(sql) ⇒ Object
10 11 12 |
# File 'lib/syntropy/db/store.rb', line 10 def query(sql, *, **) @connection_pool.with_db { it.query(sql, *, **) } end |
#query_single_row(sql) ⇒ Object
14 15 16 |
# File 'lib/syntropy/db/store.rb', line 14 def query_single_row(sql, *, **) @connection_pool.with_db { it.query_single(sql, *, **) } end |
#query_single_value(sql) ⇒ Object
18 19 20 |
# File 'lib/syntropy/db/store.rb', line 18 def query_single_value(sql, *, **) @connection_pool.with_db { it.query_single_splat(sql, *, **) } end |
#transaction ⇒ Object
26 27 28 |
# File 'lib/syntropy/db/store.rb', line 26 def transaction(&) @connection_pool.with_db(&) end |