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 = []) ⇒ Object
- #session(&block) ⇒ Object
- #start(parent: Async::Task.current) ⇒ Object
- #stats ⇒ Object
- #transaction(&block) ⇒ Object
Constructor Details
#initialize(connection_args = nil, guard: :default, **pool_opts) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 |
# File 'lib/pg_pipeline/client.rb', line 17 def initialize(connection_args = nil, guard: :default, **pool_opts) @guard = SessionGuard.normalize_mode!(guard) @pool = Pool.new(connection_args, **pool_opts) @started = false @owner_thread = nil @scheduler = nil end |
Instance Attribute Details
#guard ⇒ Object (readonly)
Returns the value of attribute guard.
15 16 17 |
# File 'lib/pg_pipeline/client.rb', line 15 def guard @guard end |
Class Method Details
Instance Method Details
#prepare(name, sql, param_types = nil) ⇒ Object
31 |
# File 'lib/pg_pipeline/client.rb', line 31 def prepare(name, sql, param_types = nil) = ClientOps.prepare(self, name, sql, param_types) |
#query(sql, params = []) ⇒ Object
30 |
# File 'lib/pg_pipeline/client.rb', line 30 def query(sql, params = []) = ClientOps.query(self, sql, params) |
#session(&block) ⇒ Object
34 35 36 |
# File 'lib/pg_pipeline/client.rb', line 34 def session(&block) ClientOps.session(self, &block) end |
#start(parent: Async::Task.current) ⇒ Object
29 |
# File 'lib/pg_pipeline/client.rb', line 29 def start(parent: Async::Task.current) = ClientOps.start(self, parent) |
#transaction(&block) ⇒ Object
38 39 40 |
# File 'lib/pg_pipeline/client.rb', line 38 def transaction(&block) ClientOps.transaction(self, &block) end |