Sha256: 79686615d0f4a45a60cc3f4de1d4d99d6c672bb855f81363b0845f19d21d349a

Contents?: true

Size: 639 Bytes

Versions: 25

Compression:

Stored size: 639 Bytes

Contents

module Vertica
  module Messages
    class Bind < FrontendMessage
      message_id 'B'

      def initialize(portal_name, prepared_statement_name, parameter_values)
        @portal_name = portal_name
        @prepared_statement_name = prepared_statement_name
        @parameter_values = parameter_values
      end

      def to_bytes
        bytes = [@portal_name, @prepared_statement_name, 0, @parameter_values.length].pack('Z*Z*nn')
        bytes << @parameter_values.map { |val| val.nil? ? [-1].pack('N') : [val.length, val].pack('Na*') }.join('')
        bytes << [0].pack('n')
        message_string bytes
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
vertica-0.12.0 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.11.4 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.11.3 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.11.2 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.11.1 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.11.0 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.10.5 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.10.4 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.10.3 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.10.2 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.10.1 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.10.0 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.6 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.5 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.4 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.3 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.2 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.1 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.0 lib/vertica/messages/frontend_messages/bind.rb
vertica-0.9.0.beta9 lib/vertica/messages/frontend_messages/bind.rb