Documentation
¶
Index ¶
- Variables
- func NewAssociativeResultRowsFromExecuteQueryResponse(e *proto.ExecuteQueryResponse, bytesAsArray bool) (interface{}, error)
- func NewResultRowsFromExecuteQueryResponse(e *proto.ExecuteQueryResponse, bytesAsArray bool) (interface{}, error)
- func NewValuesFromQueryValues(dest [][]interface{}, v []*proto.Values, bytesAsArray bool) error
- type AssociativeRows
- type ByteSliceAsArray
- type Encoder
- type Result
- type ResultWithRows
- type Rows
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTypesColumnsLengthViolation is returned when a results // object doesn't have the same number of types and columns ErrTypesColumnsLengthViolation = errors.New("types and columns are different lengths") )
Functions ¶
func NewAssociativeResultRowsFromExecuteQueryResponse ¶
func NewAssociativeResultRowsFromExecuteQueryResponse(e *proto.ExecuteQueryResponse, bytesAsArray bool) (interface{}, error)
func NewResultRowsFromExecuteQueryResponse ¶
func NewResultRowsFromExecuteQueryResponse(e *proto.ExecuteQueryResponse, bytesAsArray bool) (interface{}, error)
NewResultRowsFromExecuteQueryResponse returns an API object from an ExecuteQueryResponse.
Types ¶
type AssociativeRows ¶
type AssociativeRows struct {
Types map[string]string `json:"types,omitempty"`
Rows []map[string]interface{} `json:"rows"`
Error string `json:"error,omitempty"`
Time float64 `json:"time,omitempty"`
}
AssociativeRows represents the outcome of an operation that returns query data.
func NewAssociativeRowsFromQueryRows ¶
func NewAssociativeRowsFromQueryRows(q *proto.QueryRows, bytesAsArray bool) (*AssociativeRows, error)
NewAssociativeRowsFromQueryRows returns an associative API object from a QueryRows
type ByteSliceAsArray ¶
type ByteSliceAsArray []byte
ByteSliceAsArray is a byte slice that marshals to a JSON array of integers.
func (ByteSliceAsArray) MarshalJSON ¶
func (b ByteSliceAsArray) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface. It marshals the byte slice as an array of integers.
type Encoder ¶
Encoder is used to JSON marshal ExecuteResults, QueryRows and ExecuteQueryRequests.
func (*Encoder) JSONMarshal ¶
JSONMarshal implements the marshal interface
type Result ¶
type Result struct {
LastInsertID int64 `json:"last_insert_id,omitempty"`
RowsAffected int64 `json:"rows_affected,omitempty"`
Error string `json:"error,omitempty"`
Time float64 `json:"time,omitempty"`
}
Result represents the outcome of an operation that changes rows.
func NewResultFromExecuteResult ¶
func NewResultFromExecuteResult(e *proto.ExecuteResult) (*Result, error)
NewResultFromExecuteResult returns an API Result object from an ExecuteResult.
type ResultWithRows ¶
ResultWithRows represents the outcome of an operation that changes rows, but also includes an nil rows object, so clients can distinguish between a query and execute result.
type Rows ¶
type Rows struct {
Columns []string `json:"columns,omitempty"`
Types []string `json:"types,omitempty"`
Values [][]interface{} `json:"values,omitempty"`
Error string `json:"error,omitempty"`
Time float64 `json:"time,omitempty"`
}
Rows represents the outcome of an operation that returns query data.