lib/sequel_core/adapters/postgres.rb
def execute_prepared_statement(name, opts={})
        ps = prepared_statements[name]
        sql = ps.prepared_sql
        ps_name = name.to_s
        args = opts[:arguments]
        synchronize(opts[:server]) do |conn|
          unless conn.prepared_statements[ps_name] == sql
            if conn.prepared_statements.include?(ps_name)
              s = "DEALLOCATE #{ps_name}"
              log_info(s)
              conn.execute(s) unless conn.prepared_statements[ps_name] == sql
            end
            conn.prepared_statements[ps_name] = sql
            log_info("PREPARE #{ps_name} AS #{sql}")
            conn.prepare(ps_name, sql)
          end
          log_info("EXECUTE #{ps_name}", args)
          q = conn.exec_prepared(ps_name, args)
          if opts[:table] && opts[:values]
            insert_result(conn, opts[:table], opts[:values])
          else
            begin
              block_given? ? yield(q) : q.cmd_tuples
            ensure
              q.clear
            end
          end
        end
      end
# Execute the prepared statement with the given name on an available
# connection, using the given args.  If the connection has not prepared
# a statement with the given name yet, prepare it.  If the connection
# has prepared a statement with the same name and different SQL,
# deallocate that statement first and then prepare this statement.
# If a block is given, yield the result, otherwise, return the number
# of rows changed.  If the :insert option is passed, return the value
# of the primary key for the last inserted row.
Execute the prepared statement with the given name on an available
connection, using the given args.  If the connection has not prepared
a statement with the given name yet, prepare it.  If the connection
has prepared a statement with the same name and different SQL,
deallocate that statement first and then prepare this statement.
If a block is given, yield the result, otherwise, return the number
of rows changed.  If the :insert option is passed, return the value
of the primary key for the last inserted row.
Execute the prepared statement with the given name on an available connection using the given args . If the connection has not prepared a statement with the given name yet prepare it . If the connection has prepared a statement with the same name and different SQL deallocate that statement first and then prepare this statement . If a block is given yield the result otherwise return the number of rows changed . If the : insert option is passed return the value of the primary key for the last inserted row .
def execute_prepared_statement(name, opts={})
        ps = prepared_statements[name]
        sql = ps.prepared_sql
        ps_name = name.to_s
        args = opts[:arguments]
        synchronize(opts[:server]) do |conn|
          unless conn.prepared_statements[ps_name] == sql
            if conn.prepared_statements.include?(ps_name)
              s = "DEALLOCATE #{ps_name}"
              log_info(s)
              conn.execute(s) unless conn.prepared_statements[ps_name] == sql
            end
            conn.prepared_statements[ps_name] = sql
            log_info("PREPARE #{ps_name} AS #{sql}")
            conn.prepare(ps_name, sql)
          end
          log_info("EXECUTE #{ps_name}", args)
          q = conn.exec_prepared(ps_name, args)
          if opts[:table] && opts[:values]
            insert_result(conn, opts[:table], opts[:values])
          else
            begin
              block_given? ? yield(q) : q.cmd_tuples
            ensure
              q.clear
            end
          end
        end
      end
def execute_prepared_statement ( name , opts = { } ) ps = prepared_statements [ name ] sql = ps . prepared_sql ps_name = name . to_s args = opts [ :arguments ] synchronize ( opts [ :server ] ) do | conn | unless conn . prepared_statements [ ps_name ] == sql if conn . prepared_statements . include? ( ps_name ) s = "DEALLOCATE #{ps_name}" log_info ( s ) conn . execute ( s ) unless conn . prepared_statements [ ps_name ] == sql end conn . prepared_statements [ ps_name ] = sql log_info ( "PREPARE #{ps_name} AS #{sql}" ) conn . prepare ( ps_name , sql ) end log_info ( "EXECUTE #{ps_name}" , args ) q = conn . exec_prepared ( ps_name , args ) if opts [ :table ] && opts [ :values ] insert_result ( conn , opts [ :table ] , opts [ :values ] ) else begin block_given? ? yield ( q ) : q . cmd_tuples ensure q . clear end end end end
Execute the prepared statement with the given name on an available
connection, using the given args.
Execute the prepared statement with the given name on an available connection using the given args .
name
opts