Class: PgPipeline::PreparedStatement
- Inherits:
-
Object
- Object
- PgPipeline::PreparedStatement
- Defined in:
- lib/pg_pipeline/prepared_statement.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#param_types ⇒ Object
readonly
Returns the value of attribute param_types.
-
#physical_name ⇒ Object
readonly
Returns the value of attribute physical_name.
-
#sql ⇒ Object
readonly
Returns the value of attribute sql.
Instance Method Summary collapse
-
#initialize(client:, name:, physical_name:, sql:, param_types: nil) ⇒ PreparedStatement
constructor
A new instance of PreparedStatement.
- #inspect ⇒ Object
- #query(params = []) ⇒ Object (also: #call)
Constructor Details
#initialize(client:, name:, physical_name:, sql:, param_types: nil) ⇒ PreparedStatement
Returns a new instance of PreparedStatement.
10 11 12 13 14 15 16 17 |
# File 'lib/pg_pipeline/prepared_statement.rb', line 10 def initialize(client:, name:, physical_name:, sql:, param_types: nil) @client = client @name = PreparedStatementOps.snapshot_name(name) @physical_name = PreparedStatementOps.snapshot_name(physical_name) @sql = RequestOps.snapshot_sql(sql) @param_types = RequestOps.snapshot_param_types(param_types) freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/pg_pipeline/prepared_statement.rb', line 8 def name @name end |
#param_types ⇒ Object (readonly)
Returns the value of attribute param_types.
8 9 10 |
# File 'lib/pg_pipeline/prepared_statement.rb', line 8 def param_types @param_types end |
#physical_name ⇒ Object (readonly)
Returns the value of attribute physical_name.
8 9 10 |
# File 'lib/pg_pipeline/prepared_statement.rb', line 8 def physical_name @physical_name end |
#sql ⇒ Object (readonly)
Returns the value of attribute sql.
8 9 10 |
# File 'lib/pg_pipeline/prepared_statement.rb', line 8 def sql @sql end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/pg_pipeline/prepared_statement.rb', line 22 def inspect "#<#{self.class} name=#{@name.inspect} sql=#{@sql.inspect}>" end |
#query(params = []) ⇒ Object Also known as: call
19 |
# File 'lib/pg_pipeline/prepared_statement.rb', line 19 def query(params = []) = PreparedStatementOps.query(self, params) |