Class: PostgresPR::RowDescription

### Home Classes Methods

### In Files

- lib/postgres-pr/message.rb

### Parent

PostgresPR::Message

### Namespace

- CLASS PostgresPR::RowDescription::FieldInfo

### Methods

- #dump
- #parse

### Files

- 1q

### Class/Module Index

Quicksearch

- PostgresPR
- PostgresPR::Authentification
- PostgresPR::AuthentificationClearTextPassword
- PostgresPR::AuthentificationCryptPassword
- PostgresPR::AuthentificationKerberosV4
- PostgresPR::AuthentificationKerberosV5
- PostgresPR::AuthentificationMD5Password
- PostgresPR::AuthentificationOk
- PostgresPR::AuthentificationSCMCredential
- PostgresPR::BackendKeyData
- PostgresPR::CommandComplete
- PostgresPR::Connection
- PostgresPR::Connection::Result
- PostgresPR::CopyInResponse
- PostgresPR::CopyOutResponse
- PostgresPR::DataRow
- PostgresPR::DumpError
- PostgresPR::EmptyQueryResponse
- PostgresPR::ErrorResponse
- PostgresPR::Message
- PostgresPR::NoticeErrorMixin
- PostgresPR::NoticeResponse
- PostgresPR::ParameterStatus
- PostgresPR::Parse
- PostgresPR::ParseComplete
- PostgresPR::ParseError
- PostgresPR::PasswordMessage
- PostgresPR::Query
- PostgresPR::ReadyForQuery
- PostgresPR::RowDescription
- PostgresPR::RowDescription::FieldInfo
- PostgresPR::SSLRequest
- PostgresPR::SaltedAuthentificationMixin
- PostgresPR::StartupMessage
- PostgresPR::Terminate
- PostgresPR::UnknownAuthType
- PostgresPR::UnknownMessageType
- Buffer
- Buffer::EOF
- Buffer::Error
- Postgres
- Postgres::Conversion
- Postgres::Conversion::ConversionError
- BinaryReaderMixin
- BinaryWriterMixin
- ByteOrder
- IO
- PGError
- PGconn
- PGresult
- TC_Conversion

No matching classes.

# PostgresPR::RowDescription

### Public Instance Methods

dump() click to toggle source

    # File lib/postgres-pr/message.rb, line 441
    def dump
      sz = @fields.inject(2) {|sum, fld| sum + 18 + fld.name.size + 1 }
      super(sz) do |buffer|
        buffer.write_int16_network(@fields.size)
        @fields.each { |f|
          buffer.write_cstring(f.name)
          buffer.write_int32_network(f.oid)
          buffer.write_int16_network(f.attr_nr)
          buffer.write_int32_network(f.type_oid)
          buffer.write_int16_network(f.typlen)
          buffer.write_int32_network(f.atttypmod)
          buffer.write_int16_network(f.formatcode)
        }
      end
    end

parse(buffer) click to toggle source

    # File lib/postgres-pr/message.rb, line 457
    def parse(buffer)
      super do
        n_fields = buffer.read_int16_network
        @fields = (1..n_fields).collect {
          f = FieldInfo.new
          f.name       = buffer.read_cstring
          f.oid        = buffer.read_int32_network
          f.attr_nr    = buffer.read_int16_network
          f.type_oid   = buffer.read_int32_network
          f.typlen     = buffer.read_int16_network
          f.atttypmod  = buffer.read_int32_network
          f.formatcode = buffer.read_int16_network
          f
        }
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.