Documentation
¶
Overview ¶
Package protocol implements the hdb command network protocol.
http://help.sap.com/hana/SAP_HANA_SQL_Command_Network_Protocol_Reference_en.pdf
Index ¶
- type DataType
- type ErrorLevel
- type Field
- type FieldSet
- type FieldValues
- type PartAttributes
- type QueryType
- type Session
- func (s *Session) BadErr() error
- func (s *Session) Call(id uint64, prmFieldSet *FieldSet, args []driver.Value) (*FieldValues, []*TableResult, error)
- func (s *Session) Close() error
- func (s *Session) CloseResultsetID(id uint64) error
- func (s *Session) Commit() error
- func (s *Session) DropStatementID(id uint64) error
- func (s *Session) Exec(id uint64, parameterFieldSet *FieldSet, args []driver.Value) (driver.Result, error)
- func (s *Session) ExecDirect(query string) (driver.Result, error)
- func (s *Session) FetchNext(id uint64, resultFieldSet *FieldSet) (*FieldValues, PartAttributes, error)
- func (s *Session) InTx() bool
- func (s *Session) IsBad() bool
- func (s *Session) Prepare(query string) (QueryType, uint64, *FieldSet, *FieldSet, error)
- func (s *Session) Query(stmtID uint64, parameterFieldSet *FieldSet, resultFieldSet *FieldSet, ...) (uint64, *FieldValues, PartAttributes, error)
- func (s *Session) QueryDirect(query string) (uint64, *FieldSet, *FieldValues, PartAttributes, error)
- func (s *Session) Rollback() error
- func (s *Session) SetInTx(v bool)
- type Sniffer
- type TableResult
- type TypeCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataType ¶
type DataType byte
DataType is the type definition for data types supported by this package.
type ErrorLevel ¶
type ErrorLevel int8
ErrorLevel send from database server.
const ( HdbWarning ErrorLevel = 0 HdbError ErrorLevel = 1 HdbFatalError ErrorLevel = 2 )
HDB error level constants.
func (ErrorLevel) String ¶
func (i ErrorLevel) String() string
type FieldSet ¶
type FieldSet struct {
// contains filtered or unexported fields
}
FieldSet contains database field metadata.
func (*FieldSet) NumInputField ¶
NumInputField returns the number of input fields in a database statement.
func (*FieldSet) NumOutputField ¶
NumOutputField returns the number of output fields of a query or stored procedure.
func (*FieldSet) OutputNames ¶
OutputNames fills the names parameter with field names of all output fields. The size of the names slice must be at least NumOutputField big.
type FieldValues ¶
type FieldValues struct {
// contains filtered or unexported fields
}
FieldValues contains rows read from database.
func (*FieldValues) NumRow ¶
func (f *FieldValues) NumRow() int
NumRow returns the number of rows available in FieldValues.
func (*FieldValues) Row ¶
func (f *FieldValues) Row(idx int, dest []driver.Value)
Row fills the dest value slice with row data at index idx.
func (*FieldValues) String ¶
func (f *FieldValues) String() string
type PartAttributes ¶
PartAttributes is an interface defining methods for reading query resultset parts.
type QueryType ¶
type QueryType byte
QueryType is the type definition for query types supported by this package.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a HDB session.
func NewSession ¶
NewSession creates a new database session.
func (*Session) Call ¶
func (s *Session) Call(id uint64, prmFieldSet *FieldSet, args []driver.Value) (*FieldValues, []*TableResult, error)
Call executes a stored procedure.
func (*Session) CloseResultsetID ¶
CloseResultsetID releases the hdb resultset handle.
func (*Session) DropStatementID ¶
DropStatementID releases the hdb statement handle.
func (*Session) Exec ¶
func (s *Session) Exec(id uint64, parameterFieldSet *FieldSet, args []driver.Value) (driver.Result, error)
Exec executes a sql statement.
func (*Session) ExecDirect ¶
ExecDirect executes a sql statement without statement parameters.
func (*Session) FetchNext ¶
func (s *Session) FetchNext(id uint64, resultFieldSet *FieldSet) (*FieldValues, PartAttributes, error)
FetchNext fetches next chunk in query result set.
func (*Session) Query ¶
func (s *Session) Query(stmtID uint64, parameterFieldSet *FieldSet, resultFieldSet *FieldSet, args []driver.Value) (uint64, *FieldValues, PartAttributes, error)
Query executes a query.
func (*Session) QueryDirect ¶
func (s *Session) QueryDirect(query string) (uint64, *FieldSet, *FieldValues, PartAttributes, error)
QueryDirect executes a query without query parameters.
type Sniffer ¶
type Sniffer struct {
// contains filtered or unexported fields
}
A Sniffer is a simple proxy for logging hdb protocol requests and responses.
func NewSniffer ¶
NewSniffer creates a new sniffer instance. The conn parameter is the net.Conn connection, where the Sniffer is listening for hdb protocol calls. The dbAddr is the hdb host port address in "host:port" format.
type TableResult ¶
type TableResult struct {
// contains filtered or unexported fields
}
TableResult is the package internal representation of a table like output parameter of a stored procedure.
func (*TableResult) Attrs ¶
func (r *TableResult) Attrs() PartAttributes
Attrs returns the PartAttributes interface of the fetched resultset part.
func (*TableResult) FieldSet ¶
func (r *TableResult) FieldSet() *FieldSet
FieldSet returns the field metadata of the table.
func (*TableResult) FieldValues ¶
func (r *TableResult) FieldValues() *FieldValues
FieldValues returns the field values (fetched resultset part) of the table.
Source Files
¶
- clientid.go
- command.go
- connectoption.go
- connectoption_string.go
- connectoptions.go
- datatype.go
- datatype_string.go
- doc.go
- endianess.go
- endianess_string.go
- error.go
- errorlevel.go
- errorlevel_string.go
- fetchsize.go
- field.go
- functioncode.go
- functioncode_string.go
- init.go
- littleendian.go
- lob.go
- message.go
- messagetype.go
- messagetype_string.go
- option.go
- parameter.go
- part.go
- partkind.go
- partkind_string.go
- querytype.go
- querytype_string.go
- result.go
- rowsaffected.go
- scramsha256.go
- segment.go
- segmentkind.go
- segmentkind_string.go
- session.go
- sniffer.go
- statementcontext.go
- statementcontexttype.go
- statementcontexttype_string.go
- statementid.go
- tableresult.go
- time.go
- topology.go
- topologyoption.go
- topologyoption_string.go
- transactionflags.go
- transactionflagtype.go
- transactionflagtype_string.go
- typecode.go
- typecode_string.go