Documentation ¶
Overview ¶
Package driver is a generated protocol buffer package.
It is generated from these files:
cockroach/sql/driver/wire.proto
It has these top-level messages:
Datum Request Response
Index ¶
- Constants
- Variables
- func RegisterSender(scheme string, f NewSenderFunc)
- type Date
- type Datum
- func (m *Datum) GetBoolVal() bool
- func (m *Datum) GetBytesVal() []byte
- func (m *Datum) GetDateVal() int64
- func (m *Datum) GetFloatVal() float64
- func (m *Datum) GetIntVal() int64
- func (m *Datum) GetIntervalVal() int64
- func (m *Datum) GetPayload() isDatum_Payload
- func (m *Datum) GetStringVal() string
- func (m *Datum) GetTimeVal() *Datum_Timestamp
- func (m *Datum) Marshal() (data []byte, err error)
- func (m *Datum) MarshalTo(data []byte) (int, error)
- func (*Datum) ProtoMessage()
- func (m *Datum) Reset()
- func (m *Datum) Size() (n int)
- func (m *Datum) String() string
- func (m *Datum) Unmarshal(data []byte) error
- func (d Datum) Value() (driver.Value, error)
- func (*Datum) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Datum_BoolVal
- type Datum_BytesVal
- type Datum_DateVal
- type Datum_FloatVal
- type Datum_IntVal
- type Datum_IntervalVal
- type Datum_StringVal
- type Datum_TimeVal
- type Datum_Timestamp
- func (t Datum_Timestamp) GoTime() time.Time
- func (m *Datum_Timestamp) Marshal() (data []byte, err error)
- func (m *Datum_Timestamp) MarshalTo(data []byte) (int, error)
- func (*Datum_Timestamp) ProtoMessage()
- func (m *Datum_Timestamp) Reset()
- func (m *Datum_Timestamp) Size() (n int)
- func (m *Datum_Timestamp) String() string
- func (m *Datum_Timestamp) Unmarshal(data []byte) error
- type Method
- type NewSenderFunc
- type Request
- func (Request) CreateReply() Response
- func (r Request) GetUser() string
- func (m *Request) Marshal() (data []byte, err error)
- func (m *Request) MarshalTo(data []byte) (int, error)
- func (Request) Method() Method
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) Size() (n int)
- func (m *Request) String() string
- func (m *Request) Unmarshal(data []byte) error
- type Response
- type Response_Result
- func (m *Response_Result) GetDDL() *Response_Result_DDL
- func (m *Response_Result) GetRows() *Response_Result_Rows
- func (m *Response_Result) GetRowsAffected() uint32
- func (m *Response_Result) GetUnion() isResponse_Result_Union
- func (m *Response_Result) Marshal() (data []byte, err error)
- func (m *Response_Result) MarshalTo(data []byte) (int, error)
- func (*Response_Result) ProtoMessage()
- func (m *Response_Result) Reset()
- func (m *Response_Result) Size() (n int)
- func (m *Response_Result) String() string
- func (m *Response_Result) Unmarshal(data []byte) error
- func (*Response_Result) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Response_Result_DDL
- func (m *Response_Result_DDL) Marshal() (data []byte, err error)
- func (m *Response_Result_DDL) MarshalTo(data []byte) (int, error)
- func (*Response_Result_DDL) ProtoMessage()
- func (m *Response_Result_DDL) Reset()
- func (m *Response_Result_DDL) Size() (n int)
- func (m *Response_Result_DDL) String() string
- func (m *Response_Result_DDL) Unmarshal(data []byte) error
- type Response_Result_DDL_
- type Response_Result_Rows
- func (m *Response_Result_Rows) Marshal() (data []byte, err error)
- func (m *Response_Result_Rows) MarshalTo(data []byte) (int, error)
- func (*Response_Result_Rows) ProtoMessage()
- func (m *Response_Result_Rows) Reset()
- func (m *Response_Result_Rows) Size() (n int)
- func (m *Response_Result_Rows) String() string
- func (m *Response_Result_Rows) Unmarshal(data []byte) error
- type Response_Result_RowsAffected
- type Response_Result_Rows_
- type Response_Result_Rows_Column
- func (m *Response_Result_Rows_Column) Marshal() (data []byte, err error)
- func (m *Response_Result_Rows_Column) MarshalTo(data []byte) (int, error)
- func (*Response_Result_Rows_Column) ProtoMessage()
- func (m *Response_Result_Rows_Column) Reset()
- func (m *Response_Result_Rows_Column) Size() (n int)
- func (m *Response_Result_Rows_Column) String() string
- func (m *Response_Result_Rows_Column) Unmarshal(data []byte) error
- type Response_Result_Rows_Row
- func (m *Response_Result_Rows_Row) Marshal() (data []byte, err error)
- func (m *Response_Result_Rows_Row) MarshalTo(data []byte) (int, error)
- func (*Response_Result_Rows_Row) ProtoMessage()
- func (m *Response_Result_Rows_Row) Reset()
- func (m *Response_Result_Rows_Row) Size() (n int)
- func (m *Response_Result_Rows_Row) String() string
- func (m *Response_Result_Rows_Row) Unmarshal(data []byte) error
- type Sender
Constants ¶
const ( // Endpoint is the URL path prefix which accepts incoming // HTTP requests for the SQL API. Endpoint = "/sql/" )
const RPCMethod = "Server.SQL"
RPCMethod is the name of the RPC method for SQL requests.
const ( // StatusTooManyRequests indicates client should retry due to // server having too many requests. StatusTooManyRequests = 429 )
Variables ¶
var ( ErrInvalidLengthWire = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWire = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterSender ¶
func RegisterSender(scheme string, f NewSenderFunc)
RegisterSender registers the specified function to be used for creation of a new sender when the specified scheme is encountered.
Types ¶
type Date ¶
type Date int64
Date is the number of days since the Unix epoch. It provides a custom String() method.
type Datum ¶
type Datum struct { // Using explicit proto types provides convenient access when using json. If // we used a Kind+Bytes approach the json interface would involve base64 // encoded data. // // Types that are valid to be assigned to Payload: // *Datum_BoolVal // *Datum_IntVal // *Datum_FloatVal // *Datum_BytesVal // *Datum_StringVal // *Datum_DateVal // *Datum_TimeVal // *Datum_IntervalVal Payload isDatum_Payload `protobuf_oneof:"payload"` }
func (*Datum) GetBoolVal ¶
func (*Datum) GetBytesVal ¶
func (*Datum) GetDateVal ¶
func (*Datum) GetFloatVal ¶
func (*Datum) GetIntervalVal ¶
func (*Datum) GetPayload ¶
func (m *Datum) GetPayload() isDatum_Payload
func (*Datum) GetStringVal ¶
func (*Datum) GetTimeVal ¶
func (m *Datum) GetTimeVal() *Datum_Timestamp
func (*Datum) ProtoMessage ¶
func (*Datum) ProtoMessage()
type Datum_BoolVal ¶
type Datum_BoolVal struct {
BoolVal bool `protobuf:"varint,1,opt,name=bool_val,oneof"`
}
func (*Datum_BoolVal) Size ¶
func (m *Datum_BoolVal) Size() (n int)
type Datum_BytesVal ¶
type Datum_BytesVal struct {
BytesVal []byte `protobuf:"bytes,4,opt,name=bytes_val,oneof"`
}
func (*Datum_BytesVal) Size ¶
func (m *Datum_BytesVal) Size() (n int)
type Datum_DateVal ¶
type Datum_DateVal struct {
DateVal int64 `protobuf:"varint,6,opt,name=date_val,oneof"`
}
func (*Datum_DateVal) Size ¶
func (m *Datum_DateVal) Size() (n int)
type Datum_FloatVal ¶
type Datum_FloatVal struct {
FloatVal float64 `protobuf:"fixed64,3,opt,name=float_val,oneof"`
}
func (*Datum_FloatVal) Size ¶
func (m *Datum_FloatVal) Size() (n int)
type Datum_IntVal ¶
type Datum_IntVal struct {
IntVal int64 `protobuf:"varint,2,opt,name=int_val,oneof"`
}
func (*Datum_IntVal) Size ¶
func (m *Datum_IntVal) Size() (n int)
type Datum_IntervalVal ¶
type Datum_IntervalVal struct {
IntervalVal int64 `protobuf:"varint,8,opt,name=interval_val,oneof"`
}
func (*Datum_IntervalVal) MarshalTo ¶
func (m *Datum_IntervalVal) MarshalTo(data []byte) (int, error)
func (*Datum_IntervalVal) Size ¶
func (m *Datum_IntervalVal) Size() (n int)
type Datum_StringVal ¶
type Datum_StringVal struct {
StringVal string `protobuf:"bytes,5,opt,name=string_val,oneof"`
}
func (*Datum_StringVal) Size ¶
func (m *Datum_StringVal) Size() (n int)
type Datum_TimeVal ¶
type Datum_TimeVal struct {
TimeVal *Datum_Timestamp `protobuf:"bytes,7,opt,name=time_val,oneof"`
}
func (*Datum_TimeVal) Size ¶
func (m *Datum_TimeVal) Size() (n int)
type Datum_Timestamp ¶
type Datum_Timestamp struct { // The time in seconds since, January 1, 1970 UTC (Unix time). Sec int64 `protobuf:"varint,1,opt,name=sec" json:"sec"` // nsec specifies a non-negative nanosecond offset within sec. // It must be in the range [0, 999999999]. Nsec uint32 `protobuf:"varint,2,opt,name=nsec" json:"nsec"` }
Timestamp represents an absolute timestamp devoid of time-zone.
func Timestamp ¶
func Timestamp(t time.Time) Datum_Timestamp
Timestamp converts a time.Time to a timestamp.
func (Datum_Timestamp) GoTime ¶
func (t Datum_Timestamp) GoTime() time.Time
GoTime returns the receiver as a time.Time.
func (*Datum_Timestamp) Marshal ¶
func (m *Datum_Timestamp) Marshal() (data []byte, err error)
func (*Datum_Timestamp) ProtoMessage ¶
func (*Datum_Timestamp) ProtoMessage()
func (*Datum_Timestamp) Reset ¶
func (m *Datum_Timestamp) Reset()
func (*Datum_Timestamp) Size ¶
func (m *Datum_Timestamp) Size() (n int)
func (*Datum_Timestamp) String ¶
func (m *Datum_Timestamp) String() string
func (*Datum_Timestamp) Unmarshal ¶
func (m *Datum_Timestamp) Unmarshal(data []byte) error
type NewSenderFunc ¶
NewSenderFunc creates a new sender for the registered scheme.
type Request ¶
type Request struct { // User is the originating user. User string `protobuf:"bytes,1,opt,name=user" json:"user"` // Session settings that were returned in the last response that // contained them, being reflected back to the server. Session []byte `protobuf:"bytes,2,opt,name=session" json:"session,omitempty"` // SQL statement(s) to be serially executed by the server. Multiple // statements are passed as a single string separated by semicolons. Sql string `protobuf:"bytes,3,opt,name=sql" json:"sql"` // Parameters referred to in the above SQL statement(s) using "?". Params []Datum `protobuf:"bytes,4,rep,name=params" json:"params"` }
An SQL request to cockroach. A transaction can consist of multiple requests.
func (Request) CreateReply ¶
CreateReply creates an empty response for the request.
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
type Response ¶
type Response struct { // Setting that should be reflected back in all subsequent requests. // When not set, future requests should continue to use existing settings. Session []byte `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` // The list of results. There is one result object per SQL statement in the // request. Results []Response_Result `protobuf:"bytes,2,rep,name=results" json:"results"` }
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
type Response_Result ¶
type Response_Result struct { // Error is non-nil if an error occurred while executing the statement. Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` // Types that are valid to be assigned to Union: // *Response_Result_DDL_ // *Response_Result_RowsAffected // *Response_Result_Rows_ Union isResponse_Result_Union `protobuf_oneof:"union"` }
Result corresponds to the execution of a single SQL statement.
func (*Response_Result) GetDDL ¶
func (m *Response_Result) GetDDL() *Response_Result_DDL
func (*Response_Result) GetRows ¶
func (m *Response_Result) GetRows() *Response_Result_Rows
func (*Response_Result) GetRowsAffected ¶
func (m *Response_Result) GetRowsAffected() uint32
func (*Response_Result) GetUnion ¶
func (m *Response_Result) GetUnion() isResponse_Result_Union
func (*Response_Result) Marshal ¶
func (m *Response_Result) Marshal() (data []byte, err error)
func (*Response_Result) ProtoMessage ¶
func (*Response_Result) ProtoMessage()
func (*Response_Result) Reset ¶
func (m *Response_Result) Reset()
func (*Response_Result) Size ¶
func (m *Response_Result) Size() (n int)
func (*Response_Result) String ¶
func (m *Response_Result) String() string
func (*Response_Result) Unmarshal ¶
func (m *Response_Result) Unmarshal(data []byte) error
type Response_Result_DDL ¶
type Response_Result_DDL struct { }
DDL is an empty message that is used in Result's oneof. Its presence indicates that the operation was a DDL statement.
func (*Response_Result_DDL) Marshal ¶
func (m *Response_Result_DDL) Marshal() (data []byte, err error)
func (*Response_Result_DDL) MarshalTo ¶
func (m *Response_Result_DDL) MarshalTo(data []byte) (int, error)
func (*Response_Result_DDL) ProtoMessage ¶
func (*Response_Result_DDL) ProtoMessage()
func (*Response_Result_DDL) Reset ¶
func (m *Response_Result_DDL) Reset()
func (*Response_Result_DDL) Size ¶
func (m *Response_Result_DDL) Size() (n int)
func (*Response_Result_DDL) String ¶
func (m *Response_Result_DDL) String() string
func (*Response_Result_DDL) Unmarshal ¶
func (m *Response_Result_DDL) Unmarshal(data []byte) error
type Response_Result_DDL_ ¶
type Response_Result_DDL_ struct {
DDL *Response_Result_DDL `protobuf:"bytes,2,opt,name=ddl,oneof"`
}
func (*Response_Result_DDL_) MarshalTo ¶
func (m *Response_Result_DDL_) MarshalTo(data []byte) (int, error)
func (*Response_Result_DDL_) Size ¶
func (m *Response_Result_DDL_) Size() (n int)
type Response_Result_Rows ¶
type Response_Result_Rows struct { // The names and types of the columns returned in the result set // in the order specified in the SQL statement. The number of // columns will equal the number of values in each Row. Columns []*Response_Result_Rows_Column `protobuf:"bytes,1,rep,name=columns" json:"columns,omitempty"` // The rows in the result set. Rows []Response_Result_Rows_Row `protobuf:"bytes,2,rep,name=rows" json:"rows"` }
Rows encapsulates the result of an operation that returns rows.
func (*Response_Result_Rows) Marshal ¶
func (m *Response_Result_Rows) Marshal() (data []byte, err error)
func (*Response_Result_Rows) MarshalTo ¶
func (m *Response_Result_Rows) MarshalTo(data []byte) (int, error)
func (*Response_Result_Rows) ProtoMessage ¶
func (*Response_Result_Rows) ProtoMessage()
func (*Response_Result_Rows) Reset ¶
func (m *Response_Result_Rows) Reset()
func (*Response_Result_Rows) Size ¶
func (m *Response_Result_Rows) Size() (n int)
func (*Response_Result_Rows) String ¶
func (m *Response_Result_Rows) String() string
func (*Response_Result_Rows) Unmarshal ¶
func (m *Response_Result_Rows) Unmarshal(data []byte) error
type Response_Result_RowsAffected ¶
type Response_Result_RowsAffected struct {
RowsAffected uint32 `protobuf:"varint,3,opt,name=rows_affected,oneof"`
}
func (*Response_Result_RowsAffected) MarshalTo ¶
func (m *Response_Result_RowsAffected) MarshalTo(data []byte) (int, error)
func (*Response_Result_RowsAffected) Size ¶
func (m *Response_Result_RowsAffected) Size() (n int)
type Response_Result_Rows_ ¶
type Response_Result_Rows_ struct {
Rows *Response_Result_Rows `protobuf:"bytes,4,opt,name=rows,oneof"`
}
func (*Response_Result_Rows_) MarshalTo ¶
func (m *Response_Result_Rows_) MarshalTo(data []byte) (int, error)
func (*Response_Result_Rows_) Size ¶
func (m *Response_Result_Rows_) Size() (n int)
type Response_Result_Rows_Column ¶
type Response_Result_Rows_Column struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name"` Typ Datum `protobuf:"bytes,2,opt,name=typ" json:"typ"` }
A Column contains the name and type of a SQL "cell".
func (*Response_Result_Rows_Column) Marshal ¶
func (m *Response_Result_Rows_Column) Marshal() (data []byte, err error)
func (*Response_Result_Rows_Column) MarshalTo ¶
func (m *Response_Result_Rows_Column) MarshalTo(data []byte) (int, error)
func (*Response_Result_Rows_Column) ProtoMessage ¶
func (*Response_Result_Rows_Column) ProtoMessage()
func (*Response_Result_Rows_Column) Reset ¶
func (m *Response_Result_Rows_Column) Reset()
func (*Response_Result_Rows_Column) Size ¶
func (m *Response_Result_Rows_Column) Size() (n int)
func (*Response_Result_Rows_Column) String ¶
func (m *Response_Result_Rows_Column) String() string
func (*Response_Result_Rows_Column) Unmarshal ¶
func (m *Response_Result_Rows_Column) Unmarshal(data []byte) error
type Response_Result_Rows_Row ¶
type Response_Result_Rows_Row struct {
Values []Datum `protobuf:"bytes,1,rep,name=values" json:"values"`
}
A Row is a collection of values representing a row in a result.
func (*Response_Result_Rows_Row) Marshal ¶
func (m *Response_Result_Rows_Row) Marshal() (data []byte, err error)
func (*Response_Result_Rows_Row) MarshalTo ¶
func (m *Response_Result_Rows_Row) MarshalTo(data []byte) (int, error)
func (*Response_Result_Rows_Row) ProtoMessage ¶
func (*Response_Result_Rows_Row) ProtoMessage()
func (*Response_Result_Rows_Row) Reset ¶
func (m *Response_Result_Rows_Row) Reset()
func (*Response_Result_Rows_Row) Size ¶
func (m *Response_Result_Rows_Row) Size() (n int)
func (*Response_Result_Rows_Row) String ¶
func (m *Response_Result_Rows_Row) String() string
func (*Response_Result_Rows_Row) Unmarshal ¶
func (m *Response_Result_Rows_Row) Unmarshal(data []byte) error