Sha256: 5e4e759b389ec4707d102e8dfc5127a3229d44aabef5b9f09f393451869e4727

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

module Vertica
  module Messages
    class Close < FrontendMessage
      message_id ?C

      def initialize(close_type, close_name)
        @close_name = close_name
        @close_type = case close_type
        when :portal              then ?P
        when :prepared_statement  then ?S
        else raise ArgumentError.new("#{close_type} is not a valid close_type.  Must be either :portal or :prepared_statement.")
        end
      end

      def to_bytes
        message_string([
          @close_type.to_byte,
          @close_name.to_cstring
        ])
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vertica-0.8.1 lib/vertica/messages/frontend_messages/close.rb