Module: PgPipeline::PreparedStatementOps

Defined in:
lib/pg_pipeline/prepared_statement.rb

Class Method Summary collapse

Class Method Details

.query(statement, params) ⇒ Object



34
35
36
# File 'lib/pg_pipeline/prepared_statement.rb', line 34

def query(statement, params)
  ClientOps.query_prepared(statement.__send__(:client), statement, params)
end

.snapshot_name(name) ⇒ Object

Raises:

  • (ArgumentError)


38
39
40
41
42
43
44
# File 'lib/pg_pipeline/prepared_statement.rb', line 38

def snapshot_name(name)
  value = name.to_s
  raise ArgumentError, "prepared statement name must not be empty" if value.empty?
  raise ArgumentError, "prepared statement name must not contain NUL" if value.include?("\0")

  value.frozen? ? value : value.dup.freeze
end