Sha256: ba25a6d1082c24fdc958b6378e3ba0f475fdcea58e2133fc886bd2f4acc8e1e1

Contents?: true

Size: 547 Bytes

Versions: 5

Compression:

Stored size: 547 Bytes

Contents

module Vertica
  module Protocol
    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 message_body
        [@close_type, @close_name].pack('AZ*')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vertica-1.0.3 lib/vertica/protocol/frontend/close.rb
vertica-1.0.1 lib/vertica/protocol/frontend/close.rb
vertica-1.0.0 lib/vertica/protocol/frontend/close.rb
vertica-1.0.0.rc2 lib/vertica/protocol/frontend/close.rb
vertica-1.0.0.rc1 lib/vertica/protocol/frontend/close.rb