Class: DBI::DBD::Pg::PgExecutor
- Inherits:
-
Object
- Object
- DBI::DBD::Pg::PgExecutor
- Defined in:
- lib/dbd/pg/exec.rb
Overview
Convenience adaptor to hide details command execution API calls. See PgExecutorAsync subclass
Direct Known Subclasses
Instance Method Summary collapse
- #exec(sql, parameters = nil) ⇒ Object
- #exec_prepared(stmt_name, parameters = nil) ⇒ Object
-
#initialize(pg_conn) ⇒ PgExecutor
constructor
A new instance of PgExecutor.
- #prepare(stmt_name, sql) ⇒ Object
Constructor Details
#initialize(pg_conn) ⇒ PgExecutor
Returns a new instance of PgExecutor.
6 7 8 |
# File 'lib/dbd/pg/exec.rb', line 6 def initialize(pg_conn) @pg_conn = pg_conn end |
Instance Method Details
#exec(sql, parameters = nil) ⇒ Object
10 11 12 |
# File 'lib/dbd/pg/exec.rb', line 10 def exec(sql, parameters = nil) @pg_conn.exec(sql, parameters) end |
#exec_prepared(stmt_name, parameters = nil) ⇒ Object
14 15 16 |
# File 'lib/dbd/pg/exec.rb', line 14 def exec_prepared(stmt_name, parameters = nil) @pg_conn.exec_prepared(stmt_name, parameters) end |
#prepare(stmt_name, sql) ⇒ Object
18 19 20 |
# File 'lib/dbd/pg/exec.rb', line 18 def prepare(stmt_name, sql) @pg_conn.prepare(stmt_name, sql) end |