Class: PgPipeline::Client
- Inherits:
-
Object
- Object
- PgPipeline::Client
- Defined in:
- lib/pg_pipeline/client.rb
Instance Attribute Summary collapse
-
#guard ⇒ Object
readonly
Returns the value of attribute guard.
Class Method Summary collapse
Instance Method Summary collapse
- #abort! ⇒ Object
- #close ⇒ Object
-
#initialize(connection_args = nil, guard: :default, **pool_opts) ⇒ Client
constructor
A new instance of Client.
- #prepare(name, sql, param_types = nil) ⇒ Object
- #query(sql, params = RequestOps::EMPTY_PARAMS) ⇒ Object
- #session(&block) ⇒ Object
- #start ⇒ Object
- #stats ⇒ Object
- #transaction(&block) ⇒ Object
Constructor Details
#initialize(connection_args = nil, guard: :default, **pool_opts) ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 20 21 |
# File 'lib/pg_pipeline/client.rb', line 15 def initialize(connection_args = nil, guard: :default, **pool_opts) @owner_thread, @scheduler = nil, nil @guard = SessionGuard.normalize_mode!(guard) @pool = Pool.new(connection_args, **pool_opts) @started = false end |
Instance Attribute Details
#guard ⇒ Object (readonly)
Returns the value of attribute guard.
13 14 15 |
# File 'lib/pg_pipeline/client.rb', line 13 def guard @guard end |
Class Method Details
Instance Method Details
#prepare(name, sql, param_types = nil) ⇒ Object
29 |
# File 'lib/pg_pipeline/client.rb', line 29 def prepare(name, sql, param_types = nil) = ClientOps.prepare(self, name, sql, param_types) |
#query(sql, params = RequestOps::EMPTY_PARAMS) ⇒ Object
28 |
# File 'lib/pg_pipeline/client.rb', line 28 def query(sql, params = RequestOps::EMPTY_PARAMS) = ClientOps.query(self, sql, params) |
#session(&block) ⇒ Object
32 33 34 |
# File 'lib/pg_pipeline/client.rb', line 32 def session(&block) ClientOps.session(self, &block) end |
#transaction(&block) ⇒ Object
36 37 38 |
# File 'lib/pg_pipeline/client.rb', line 36 def transaction(&block) ClientOps.transaction(self, &block) end |