protocol

package
v0.0.0-...-968678e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package protocol defines the wire format for SQL statements and results.

It's kept in a separate package since this code is entirely generated by the protobuf compile, and should not affect code coverage measurements.

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestCode_name = map[int32]string{
		0:  "OPEN",
		1:  "PREPARE",
		2:  "EXEC",
		3:  "QUERY",
		4:  "NEXT",
		5:  "ROWS_CLOSE",
		6:  "COLUMN_TYPE_SCAN_TYPE",
		7:  "COLUMN_TYPE_DATABASE_TYPE_NAME",
		8:  "STMT_CLOSE",
		9:  "BEGIN",
		10: "COMMIT",
		11: "ROLLBACK",
		12: "CLOSE",
		13: "CONN_EXEC",
		14: "SQL_ERROR",
	}
	RequestCode_value = map[string]int32{
		"OPEN":                           0,
		"PREPARE":                        1,
		"EXEC":                           2,
		"QUERY":                          3,
		"NEXT":                           4,
		"ROWS_CLOSE":                     5,
		"COLUMN_TYPE_SCAN_TYPE":          6,
		"COLUMN_TYPE_DATABASE_TYPE_NAME": 7,
		"STMT_CLOSE":                     8,
		"BEGIN":                          9,
		"COMMIT":                         10,
		"ROLLBACK":                       11,
		"CLOSE":                          12,
		"CONN_EXEC":                      13,
		"SQL_ERROR":                      14,
	}
)

Enum value maps for RequestCode.

View Source
var (
	ValueCode_name = map[int32]string{
		0: "INT64",
		1: "FLOAT64",
		2: "BOOL",
		3: "BYTES",
		4: "STRING",
		5: "TIME",
		6: "NULL",
	}
	ValueCode_value = map[string]int32{
		"INT64":   0,
		"FLOAT64": 1,
		"BOOL":    2,
		"BYTES":   3,
		"STRING":  4,
		"TIME":    5,
		"NULL":    6,
	}
)

Enum value maps for ValueCode.

Functions

func FromValueCode

func FromValueCode(code ValueCode) reflect.Type

FromValueCode converts a serialized value type code into a Go type object.

func FromValueSlice

func FromValueSlice(values []*Value) ([]interface{}, error)

FromValueSlice converts a slice of protobuf Value objects to a slice of Go interface{} objects.

func RegisterSQLServer

func RegisterSQLServer(s grpc.ServiceRegistrar, srv SQLServer)

func ToDriverValues

func ToDriverValues(values []*Value) ([]driver.NamedValue, error)

ToDriverValues converts a slice of protobuf Value objects to a slice of Go driver.Value objects.

Types

type Request

type Request struct {
	Code RequestCode `protobuf:"varint,1,opt,name=code,proto3,enum=protocol.RequestCode" json:"code,omitempty"` // Code identifying the type of request, see below.
	Data []byte      `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`                            // Serialized request, maps to one of the RequestXXX messages.
	// contains filtered or unexported fields
}

A single request targeted to a certain SQL connection.

func NewRequestBegin

func NewRequestBegin(opts driver.TxOptions) *Request

NewRequestBegin creates a new Request of type RequestBegin.

func NewRequestClose

func NewRequestClose() *Request

NewRequestClose creates a new Request of type RequestClose.

func NewRequestColumnTypeDatabaseTypeName

func NewRequestColumnTypeDatabaseTypeName(id int64, column int64) *Request

NewRequestColumnTypeDatabaseTypeName creates a new Request of type ColumnTypeDatabaseTypeName.

func NewRequestColumnTypeScanType

func NewRequestColumnTypeScanType(id int64, column int64) *Request

NewRequestColumnTypeScanType creates a new Request of type ColumnTypeScanType.

func NewRequestCommit

func NewRequestCommit(id int64) *Request

NewRequestCommit creates a new Request of type RequestCommit.

func NewRequestConnExec

func NewRequestConnExec(query string, args []*Value) *Request

NewRequestConnExec creates a new Request of type RequestConnExec.

func NewRequestExec

func NewRequestExec(id int64, args []*Value) *Request

NewRequestExec creates a new Request of type RequestExec.

func NewRequestNext

func NewRequestNext(id int64, n int64) *Request

NewRequestNext creates a new Request of type RequestNext.

func NewRequestOpen

func NewRequestOpen(name string) *Request

NewRequestOpen creates a new Request of type RequestOpen.

func NewRequestPrepare

func NewRequestPrepare(query string) *Request

NewRequestPrepare creates a new Request of type RequestPrepare.

func NewRequestQuery

func NewRequestQuery(id int64, args []*Value) *Request

NewRequestQuery creates a new Request of type RequestQuery.

func NewRequestRollback

func NewRequestRollback(id int64) *Request

NewRequestRollback creates a new Request of type RequestRollback.

func NewRequestRowsClose

func NewRequestRowsClose(id int64) *Request

NewRequestRowsClose creates a new Request of type RequestRowsClose.

func NewRequestStmtClose

func NewRequestStmtClose(id int64) *Request

NewRequestStmtClose creates a new Request of type RequestStmtClose.

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetCode

func (x *Request) GetCode() RequestCode

func (*Request) GetData

func (x *Request) GetData() []byte

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type RequestBegin

type RequestBegin struct {
	Isolation int32 `protobuf:"varint,1,opt,name=isolation,proto3" json:"isolation,omitempty"`
	ReadOnly  bool  `protobuf:"varint,2,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
	// contains filtered or unexported fields
}

func (*RequestBegin) Descriptor deprecated

func (*RequestBegin) Descriptor() ([]byte, []int)

Deprecated: Use RequestBegin.ProtoReflect.Descriptor instead.

func (*RequestBegin) GetIsolation

func (x *RequestBegin) GetIsolation() int32

func (*RequestBegin) GetReadOnly

func (x *RequestBegin) GetReadOnly() bool

func (*RequestBegin) ProtoMessage

func (*RequestBegin) ProtoMessage()

func (*RequestBegin) ProtoReflect

func (x *RequestBegin) ProtoReflect() protoreflect.Message

func (*RequestBegin) Reset

func (x *RequestBegin) Reset()

func (*RequestBegin) String

func (x *RequestBegin) String() string

type RequestClose

type RequestClose struct {
	// contains filtered or unexported fields
}

func (*RequestClose) Descriptor deprecated

func (*RequestClose) Descriptor() ([]byte, []int)

Deprecated: Use RequestClose.ProtoReflect.Descriptor instead.

func (*RequestClose) ProtoMessage

func (*RequestClose) ProtoMessage()

func (*RequestClose) ProtoReflect

func (x *RequestClose) ProtoReflect() protoreflect.Message

func (*RequestClose) Reset

func (x *RequestClose) Reset()

func (*RequestClose) String

func (x *RequestClose) String() string

type RequestCode

type RequestCode int32

RequestCode is a numberic code identifying the SQL gRPC request to handle.

const (
	RequestCode_OPEN                           RequestCode = 0
	RequestCode_PREPARE                        RequestCode = 1
	RequestCode_EXEC                           RequestCode = 2
	RequestCode_QUERY                          RequestCode = 3
	RequestCode_NEXT                           RequestCode = 4
	RequestCode_ROWS_CLOSE                     RequestCode = 5
	RequestCode_COLUMN_TYPE_SCAN_TYPE          RequestCode = 6
	RequestCode_COLUMN_TYPE_DATABASE_TYPE_NAME RequestCode = 7
	RequestCode_STMT_CLOSE                     RequestCode = 8
	RequestCode_BEGIN                          RequestCode = 9
	RequestCode_COMMIT                         RequestCode = 10
	RequestCode_ROLLBACK                       RequestCode = 11
	RequestCode_CLOSE                          RequestCode = 12
	RequestCode_CONN_EXEC                      RequestCode = 13
	// XXX error codes should be part of a separate ResponseCode enum.
	RequestCode_SQL_ERROR RequestCode = 14
)

func (RequestCode) Descriptor

func (RequestCode) Enum

func (x RequestCode) Enum() *RequestCode

func (RequestCode) EnumDescriptor deprecated

func (RequestCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use RequestCode.Descriptor instead.

func (RequestCode) Number

func (x RequestCode) Number() protoreflect.EnumNumber

func (RequestCode) String

func (x RequestCode) String() string

func (RequestCode) Type

type RequestColumnTypeDatabaseTypeName

type RequestColumnTypeDatabaseTypeName struct {
	Id     int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`         // ID of the rows object.
	Column int64 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"` // Index of the column to fetch the type name of.
	// contains filtered or unexported fields
}

func (*RequestColumnTypeDatabaseTypeName) Descriptor deprecated

func (*RequestColumnTypeDatabaseTypeName) Descriptor() ([]byte, []int)

Deprecated: Use RequestColumnTypeDatabaseTypeName.ProtoReflect.Descriptor instead.

func (*RequestColumnTypeDatabaseTypeName) GetColumn

func (*RequestColumnTypeDatabaseTypeName) GetId

func (*RequestColumnTypeDatabaseTypeName) ProtoMessage

func (*RequestColumnTypeDatabaseTypeName) ProtoMessage()

func (*RequestColumnTypeDatabaseTypeName) ProtoReflect

func (*RequestColumnTypeDatabaseTypeName) Reset

func (*RequestColumnTypeDatabaseTypeName) String

type RequestColumnTypeScanType

type RequestColumnTypeScanType struct {
	Id     int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`         // ID of the rows object.
	Column int64 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"` // Index of the column to fetch the type of.
	// contains filtered or unexported fields
}

func (*RequestColumnTypeScanType) Descriptor deprecated

func (*RequestColumnTypeScanType) Descriptor() ([]byte, []int)

Deprecated: Use RequestColumnTypeScanType.ProtoReflect.Descriptor instead.

func (*RequestColumnTypeScanType) GetColumn

func (x *RequestColumnTypeScanType) GetColumn() int64

func (*RequestColumnTypeScanType) GetId

func (x *RequestColumnTypeScanType) GetId() int64

func (*RequestColumnTypeScanType) ProtoMessage

func (*RequestColumnTypeScanType) ProtoMessage()

func (*RequestColumnTypeScanType) ProtoReflect

func (*RequestColumnTypeScanType) Reset

func (x *RequestColumnTypeScanType) Reset()

func (*RequestColumnTypeScanType) String

func (x *RequestColumnTypeScanType) String() string

type RequestCommit

type RequestCommit struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Numeric identifier of the transaction.
	// contains filtered or unexported fields
}

func (*RequestCommit) Descriptor deprecated

func (*RequestCommit) Descriptor() ([]byte, []int)

Deprecated: Use RequestCommit.ProtoReflect.Descriptor instead.

func (*RequestCommit) GetId

func (x *RequestCommit) GetId() int64

func (*RequestCommit) ProtoMessage

func (*RequestCommit) ProtoMessage()

func (*RequestCommit) ProtoReflect

func (x *RequestCommit) ProtoReflect() protoreflect.Message

func (*RequestCommit) Reset

func (x *RequestCommit) Reset()

func (*RequestCommit) String

func (x *RequestCommit) String() string

type RequestConnExec

type RequestConnExec struct {
	Query string   `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // The statement to execute.
	Args  []*Value `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`   // Arguments to bind to the statement.
	// contains filtered or unexported fields
}

func (*RequestConnExec) Descriptor deprecated

func (*RequestConnExec) Descriptor() ([]byte, []int)

Deprecated: Use RequestConnExec.ProtoReflect.Descriptor instead.

func (*RequestConnExec) GetArgs

func (x *RequestConnExec) GetArgs() []*Value

func (*RequestConnExec) GetQuery

func (x *RequestConnExec) GetQuery() string

func (*RequestConnExec) ProtoMessage

func (*RequestConnExec) ProtoMessage()

func (*RequestConnExec) ProtoReflect

func (x *RequestConnExec) ProtoReflect() protoreflect.Message

func (*RequestConnExec) Reset

func (x *RequestConnExec) Reset()

func (*RequestConnExec) String

func (x *RequestConnExec) String() string

type RequestExec

type RequestExec struct {
	Id   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`    // ID of the prepared statement.
	Args []*Value `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` // Arguments to bind to the statement.
	// contains filtered or unexported fields
}

func (*RequestExec) Descriptor deprecated

func (*RequestExec) Descriptor() ([]byte, []int)

Deprecated: Use RequestExec.ProtoReflect.Descriptor instead.

func (*RequestExec) GetArgs

func (x *RequestExec) GetArgs() []*Value

func (*RequestExec) GetId

func (x *RequestExec) GetId() int64

func (*RequestExec) ProtoMessage

func (*RequestExec) ProtoMessage()

func (*RequestExec) ProtoReflect

func (x *RequestExec) ProtoReflect() protoreflect.Message

func (*RequestExec) Reset

func (x *RequestExec) Reset()

func (*RequestExec) String

func (x *RequestExec) String() string

type RequestNext

type RequestNext struct {
	Id  int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`   // ID of the rows object.
	Len int64 `protobuf:"varint,2,opt,name=len,proto3" json:"len,omitempty"` // Number of columns to fetch.
	// contains filtered or unexported fields
}

func (*RequestNext) Descriptor deprecated

func (*RequestNext) Descriptor() ([]byte, []int)

Deprecated: Use RequestNext.ProtoReflect.Descriptor instead.

func (*RequestNext) GetId

func (x *RequestNext) GetId() int64

func (*RequestNext) GetLen

func (x *RequestNext) GetLen() int64

func (*RequestNext) ProtoMessage

func (*RequestNext) ProtoMessage()

func (*RequestNext) ProtoReflect

func (x *RequestNext) ProtoReflect() protoreflect.Message

func (*RequestNext) Reset

func (x *RequestNext) Reset()

func (*RequestNext) String

func (x *RequestNext) String() string

type RequestOpen

type RequestOpen struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //  Data source name to pass to the SQL driver.
	// contains filtered or unexported fields
}

func (*RequestOpen) Descriptor deprecated

func (*RequestOpen) Descriptor() ([]byte, []int)

Deprecated: Use RequestOpen.ProtoReflect.Descriptor instead.

func (*RequestOpen) GetName

func (x *RequestOpen) GetName() string

func (*RequestOpen) ProtoMessage

func (*RequestOpen) ProtoMessage()

func (*RequestOpen) ProtoReflect

func (x *RequestOpen) ProtoReflect() protoreflect.Message

func (*RequestOpen) Reset

func (x *RequestOpen) Reset()

func (*RequestOpen) String

func (x *RequestOpen) String() string

type RequestPrepare

type RequestPrepare struct {
	Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	// contains filtered or unexported fields
}

func (*RequestPrepare) Descriptor deprecated

func (*RequestPrepare) Descriptor() ([]byte, []int)

Deprecated: Use RequestPrepare.ProtoReflect.Descriptor instead.

func (*RequestPrepare) GetQuery

func (x *RequestPrepare) GetQuery() string

func (*RequestPrepare) ProtoMessage

func (*RequestPrepare) ProtoMessage()

func (*RequestPrepare) ProtoReflect

func (x *RequestPrepare) ProtoReflect() protoreflect.Message

func (*RequestPrepare) Reset

func (x *RequestPrepare) Reset()

func (*RequestPrepare) String

func (x *RequestPrepare) String() string

type RequestQuery

type RequestQuery struct {
	Id   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`    // ID of the prepared statement.
	Args []*Value `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` // Arguments to bind to the statement.
	// contains filtered or unexported fields
}

func (*RequestQuery) Descriptor deprecated

func (*RequestQuery) Descriptor() ([]byte, []int)

Deprecated: Use RequestQuery.ProtoReflect.Descriptor instead.

func (*RequestQuery) GetArgs

func (x *RequestQuery) GetArgs() []*Value

func (*RequestQuery) GetId

func (x *RequestQuery) GetId() int64

func (*RequestQuery) ProtoMessage

func (*RequestQuery) ProtoMessage()

func (*RequestQuery) ProtoReflect

func (x *RequestQuery) ProtoReflect() protoreflect.Message

func (*RequestQuery) Reset

func (x *RequestQuery) Reset()

func (*RequestQuery) String

func (x *RequestQuery) String() string

type RequestRollback

type RequestRollback struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Numeric identifier of the transaction.
	// contains filtered or unexported fields
}

func (*RequestRollback) Descriptor deprecated

func (*RequestRollback) Descriptor() ([]byte, []int)

Deprecated: Use RequestRollback.ProtoReflect.Descriptor instead.

func (*RequestRollback) GetId

func (x *RequestRollback) GetId() int64

func (*RequestRollback) ProtoMessage

func (*RequestRollback) ProtoMessage()

func (*RequestRollback) ProtoReflect

func (x *RequestRollback) ProtoReflect() protoreflect.Message

func (*RequestRollback) Reset

func (x *RequestRollback) Reset()

func (*RequestRollback) String

func (x *RequestRollback) String() string

type RequestRowsClose

type RequestRowsClose struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the rows object.
	// contains filtered or unexported fields
}

func (*RequestRowsClose) Descriptor deprecated

func (*RequestRowsClose) Descriptor() ([]byte, []int)

Deprecated: Use RequestRowsClose.ProtoReflect.Descriptor instead.

func (*RequestRowsClose) GetId

func (x *RequestRowsClose) GetId() int64

func (*RequestRowsClose) ProtoMessage

func (*RequestRowsClose) ProtoMessage()

func (*RequestRowsClose) ProtoReflect

func (x *RequestRowsClose) ProtoReflect() protoreflect.Message

func (*RequestRowsClose) Reset

func (x *RequestRowsClose) Reset()

func (*RequestRowsClose) String

func (x *RequestRowsClose) String() string

type RequestStmtClose

type RequestStmtClose struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the prepared statement.
	// contains filtered or unexported fields
}

func (*RequestStmtClose) Descriptor deprecated

func (*RequestStmtClose) Descriptor() ([]byte, []int)

Deprecated: Use RequestStmtClose.ProtoReflect.Descriptor instead.

func (*RequestStmtClose) GetId

func (x *RequestStmtClose) GetId() int64

func (*RequestStmtClose) ProtoMessage

func (*RequestStmtClose) ProtoMessage()

func (*RequestStmtClose) ProtoReflect

func (x *RequestStmtClose) ProtoReflect() protoreflect.Message

func (*RequestStmtClose) Reset

func (x *RequestStmtClose) Reset()

func (*RequestStmtClose) String

func (x *RequestStmtClose) String() string

type Response

type Response struct {
	Code RequestCode `protobuf:"varint,1,opt,name=code,proto3,enum=protocol.RequestCode" json:"code,omitempty"` // Code identifying the type of the request this response is for, see below.
	Data []byte      `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`                            // Serialized response, maps to one of the ResponseXXX messages.
	// contains filtered or unexported fields
}

A single response to a request.

func NewResponseBegin

func NewResponseBegin(id int64) *Response

NewResponseBegin creates a new Response of type ResponseBegin.

func NewResponseClose

func NewResponseClose() *Response

NewResponseClose creates a new Response of type ResponseClose.

func NewResponseColumnTypeDatabaseTypeName

func NewResponseColumnTypeDatabaseTypeName(name string) *Response

NewResponseColumnTypeDatabaseTypeName creates a new Response of type ResponseColumnTypeDatabaseTypeName.

func NewResponseColumnTypeScanType

func NewResponseColumnTypeScanType(code ValueCode) *Response

NewResponseColumnTypeScanType creates a new Response of type ResponseColumnTypeScanType.

func NewResponseCommit

func NewResponseCommit() *Response

NewResponseCommit creates a new Response of type ResponseCommit.

func NewResponseExec

func NewResponseExec(lastInsertID, rowsAffected int64) *Response

NewResponseExec creates a new Response of type ResponseExec.

func NewResponseNext

func NewResponseNext(eof bool, values []*Value) *Response

NewResponseNext creates a new Response of type ResponseNext.

func NewResponseOpen

func NewResponseOpen() *Response

NewResponseOpen creates a new Response of type ResponseOpen.

func NewResponsePrepare

func NewResponsePrepare(id int64, numInput int) *Response

NewResponsePrepare creates a new Response of type ResponsePrepare.

func NewResponseQuery

func NewResponseQuery(id int64, columns []string) *Response

NewResponseQuery creates a new Response of type ResponseQuery.

func NewResponseRollback

func NewResponseRollback() *Response

NewResponseRollback creates a new Response of type ResponseRollback.

func NewResponseRowsClose

func NewResponseRowsClose() *Response

NewResponseRowsClose creates a new Response of type ResponseRowsClose.

func NewResponseSQLError

func NewResponseSQLError(code, extendedCode int32, err string) *Response

NewResponseSQLError creates a new Response of type ResponseSQLError.

func NewResponseStmtClose

func NewResponseStmtClose() *Response

NewResponseStmtClose creates a new Response of type ResponseStmtClose.

func (*Response) Begin

func (r *Response) Begin() *ResponseBegin

Begin returns a ResponseBegin payload.

func (*Response) ColumnTypeDatabaseTypeName

func (r *Response) ColumnTypeDatabaseTypeName() *ResponseColumnTypeDatabaseTypeName

ColumnTypeDatabaseTypeName returns a ResponseColumnTypeDatabaseTypeName payload.

func (*Response) ColumnTypeScanType

func (r *Response) ColumnTypeScanType() *ResponseColumnTypeScanType

ColumnTypeScanType returns a ResponseColumnTypeScanType payload.

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) Exec

func (r *Response) Exec() *ResponseExec

Exec returns a ResponseExec payload.

func (*Response) GetCode

func (x *Response) GetCode() RequestCode

func (*Response) GetData

func (x *Response) GetData() []byte

func (*Response) Next

func (r *Response) Next() *ResponseNext

Next returns a ResponseNext payload.

func (*Response) Prepare

func (r *Response) Prepare() *ResponsePrepare

Prepare returns a ResponsePrepare payload.

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Query

func (r *Response) Query() *ResponseQuery

Query returns a ResponseQuery payload.

func (*Response) Reset

func (x *Response) Reset()

func (*Response) SQLError

func (r *Response) SQLError() *ResponseSQLError

SQLError returns a ResponseSQLError payload.

func (*Response) String

func (x *Response) String() string

type ResponseBegin

type ResponseBegin struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the newly created transaction.
	// contains filtered or unexported fields
}

func (*ResponseBegin) Descriptor deprecated

func (*ResponseBegin) Descriptor() ([]byte, []int)

Deprecated: Use ResponseBegin.ProtoReflect.Descriptor instead.

func (*ResponseBegin) GetId

func (x *ResponseBegin) GetId() int64

func (*ResponseBegin) ProtoMessage

func (*ResponseBegin) ProtoMessage()

func (*ResponseBegin) ProtoReflect

func (x *ResponseBegin) ProtoReflect() protoreflect.Message

func (*ResponseBegin) Reset

func (x *ResponseBegin) Reset()

func (*ResponseBegin) String

func (x *ResponseBegin) String() string

type ResponseClose

type ResponseClose struct {
	// contains filtered or unexported fields
}

func (*ResponseClose) Descriptor deprecated

func (*ResponseClose) Descriptor() ([]byte, []int)

Deprecated: Use ResponseClose.ProtoReflect.Descriptor instead.

func (*ResponseClose) ProtoMessage

func (*ResponseClose) ProtoMessage()

func (*ResponseClose) ProtoReflect

func (x *ResponseClose) ProtoReflect() protoreflect.Message

func (*ResponseClose) Reset

func (x *ResponseClose) Reset()

func (*ResponseClose) String

func (x *ResponseClose) String() string

type ResponseColumnTypeDatabaseTypeName

type ResponseColumnTypeDatabaseTypeName struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Column type name.
	// contains filtered or unexported fields
}

func (*ResponseColumnTypeDatabaseTypeName) Descriptor deprecated

func (*ResponseColumnTypeDatabaseTypeName) Descriptor() ([]byte, []int)

Deprecated: Use ResponseColumnTypeDatabaseTypeName.ProtoReflect.Descriptor instead.

func (*ResponseColumnTypeDatabaseTypeName) GetName

func (*ResponseColumnTypeDatabaseTypeName) ProtoMessage

func (*ResponseColumnTypeDatabaseTypeName) ProtoMessage()

func (*ResponseColumnTypeDatabaseTypeName) ProtoReflect

func (*ResponseColumnTypeDatabaseTypeName) Reset

func (*ResponseColumnTypeDatabaseTypeName) String

type ResponseColumnTypeScanType

type ResponseColumnTypeScanType struct {
	Code ValueCode `protobuf:"varint,1,opt,name=code,proto3,enum=protocol.ValueCode" json:"code,omitempty"` // Column type code.
	// contains filtered or unexported fields
}

func (*ResponseColumnTypeScanType) Descriptor deprecated

func (*ResponseColumnTypeScanType) Descriptor() ([]byte, []int)

Deprecated: Use ResponseColumnTypeScanType.ProtoReflect.Descriptor instead.

func (*ResponseColumnTypeScanType) GetCode

func (*ResponseColumnTypeScanType) ProtoMessage

func (*ResponseColumnTypeScanType) ProtoMessage()

func (*ResponseColumnTypeScanType) ProtoReflect

func (*ResponseColumnTypeScanType) Reset

func (x *ResponseColumnTypeScanType) Reset()

func (*ResponseColumnTypeScanType) String

func (x *ResponseColumnTypeScanType) String() string

type ResponseCommit

type ResponseCommit struct {
	// contains filtered or unexported fields
}

func (*ResponseCommit) Descriptor deprecated

func (*ResponseCommit) Descriptor() ([]byte, []int)

Deprecated: Use ResponseCommit.ProtoReflect.Descriptor instead.

func (*ResponseCommit) ProtoMessage

func (*ResponseCommit) ProtoMessage()

func (*ResponseCommit) ProtoReflect

func (x *ResponseCommit) ProtoReflect() protoreflect.Message

func (*ResponseCommit) Reset

func (x *ResponseCommit) Reset()

func (*ResponseCommit) String

func (x *ResponseCommit) String() string

type ResponseExec

type ResponseExec struct {
	LastInsertId int64 `protobuf:"varint,1,opt,name=LastInsertId,proto3" json:"LastInsertId,omitempty"`
	RowsAffected int64 `protobuf:"varint,2,opt,name=RowsAffected,proto3" json:"RowsAffected,omitempty"`
	// contains filtered or unexported fields
}

func (*ResponseExec) Descriptor deprecated

func (*ResponseExec) Descriptor() ([]byte, []int)

Deprecated: Use ResponseExec.ProtoReflect.Descriptor instead.

func (*ResponseExec) GetLastInsertId

func (x *ResponseExec) GetLastInsertId() int64

func (*ResponseExec) GetRowsAffected

func (x *ResponseExec) GetRowsAffected() int64

func (*ResponseExec) ProtoMessage

func (*ResponseExec) ProtoMessage()

func (*ResponseExec) ProtoReflect

func (x *ResponseExec) ProtoReflect() protoreflect.Message

func (*ResponseExec) Reset

func (x *ResponseExec) Reset()

func (*ResponseExec) String

func (x *ResponseExec) String() string

type ResponseNext

type ResponseNext struct {
	Eof    bool     `protobuf:"varint,1,opt,name=eof,proto3" json:"eof,omitempty"`
	Values []*Value `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` // Column values.
	// contains filtered or unexported fields
}

func (*ResponseNext) Descriptor deprecated

func (*ResponseNext) Descriptor() ([]byte, []int)

Deprecated: Use ResponseNext.ProtoReflect.Descriptor instead.

func (*ResponseNext) GetEof

func (x *ResponseNext) GetEof() bool

func (*ResponseNext) GetValues

func (x *ResponseNext) GetValues() []*Value

func (*ResponseNext) ProtoMessage

func (*ResponseNext) ProtoMessage()

func (*ResponseNext) ProtoReflect

func (x *ResponseNext) ProtoReflect() protoreflect.Message

func (*ResponseNext) Reset

func (x *ResponseNext) Reset()

func (*ResponseNext) String

func (x *ResponseNext) String() string

type ResponseOpen

type ResponseOpen struct {
	// contains filtered or unexported fields
}

func (*ResponseOpen) Descriptor deprecated

func (*ResponseOpen) Descriptor() ([]byte, []int)

Deprecated: Use ResponseOpen.ProtoReflect.Descriptor instead.

func (*ResponseOpen) ProtoMessage

func (*ResponseOpen) ProtoMessage()

func (*ResponseOpen) ProtoReflect

func (x *ResponseOpen) ProtoReflect() protoreflect.Message

func (*ResponseOpen) Reset

func (x *ResponseOpen) Reset()

func (*ResponseOpen) String

func (x *ResponseOpen) String() string

type ResponsePrepare

type ResponsePrepare struct {
	Id       int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`             // Numeric identifier of the new statement.
	NumInput int64 `protobuf:"varint,2,opt,name=numInput,proto3" json:"numInput,omitempty"` // Number of placeholder parameters.
	// contains filtered or unexported fields
}

func (*ResponsePrepare) Descriptor deprecated

func (*ResponsePrepare) Descriptor() ([]byte, []int)

Deprecated: Use ResponsePrepare.ProtoReflect.Descriptor instead.

func (*ResponsePrepare) GetId

func (x *ResponsePrepare) GetId() int64

func (*ResponsePrepare) GetNumInput

func (x *ResponsePrepare) GetNumInput() int64

func (*ResponsePrepare) ProtoMessage

func (*ResponsePrepare) ProtoMessage()

func (*ResponsePrepare) ProtoReflect

func (x *ResponsePrepare) ProtoReflect() protoreflect.Message

func (*ResponsePrepare) Reset

func (x *ResponsePrepare) Reset()

func (*ResponsePrepare) String

func (x *ResponsePrepare) String() string

type ResponseQuery

type ResponseQuery struct {
	Id      int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`          // Numeric identifier of the new rows result set.
	Columns []string `protobuf:"bytes,2,rep,name=columns,proto3" json:"columns,omitempty"` // Names of the columns in the result set.
	// contains filtered or unexported fields
}

func (*ResponseQuery) Descriptor deprecated

func (*ResponseQuery) Descriptor() ([]byte, []int)

Deprecated: Use ResponseQuery.ProtoReflect.Descriptor instead.

func (*ResponseQuery) GetColumns

func (x *ResponseQuery) GetColumns() []string

func (*ResponseQuery) GetId

func (x *ResponseQuery) GetId() int64

func (*ResponseQuery) ProtoMessage

func (*ResponseQuery) ProtoMessage()

func (*ResponseQuery) ProtoReflect

func (x *ResponseQuery) ProtoReflect() protoreflect.Message

func (*ResponseQuery) Reset

func (x *ResponseQuery) Reset()

func (*ResponseQuery) String

func (x *ResponseQuery) String() string

type ResponseRollback

type ResponseRollback struct {
	// contains filtered or unexported fields
}

func (*ResponseRollback) Descriptor deprecated

func (*ResponseRollback) Descriptor() ([]byte, []int)

Deprecated: Use ResponseRollback.ProtoReflect.Descriptor instead.

func (*ResponseRollback) ProtoMessage

func (*ResponseRollback) ProtoMessage()

func (*ResponseRollback) ProtoReflect

func (x *ResponseRollback) ProtoReflect() protoreflect.Message

func (*ResponseRollback) Reset

func (x *ResponseRollback) Reset()

func (*ResponseRollback) String

func (x *ResponseRollback) String() string

type ResponseRowsClose

type ResponseRowsClose struct {
	// contains filtered or unexported fields
}

func (*ResponseRowsClose) Descriptor deprecated

func (*ResponseRowsClose) Descriptor() ([]byte, []int)

Deprecated: Use ResponseRowsClose.ProtoReflect.Descriptor instead.

func (*ResponseRowsClose) ProtoMessage

func (*ResponseRowsClose) ProtoMessage()

func (*ResponseRowsClose) ProtoReflect

func (x *ResponseRowsClose) ProtoReflect() protoreflect.Message

func (*ResponseRowsClose) Reset

func (x *ResponseRowsClose) Reset()

func (*ResponseRowsClose) String

func (x *ResponseRowsClose) String() string

type ResponseSQLError

type ResponseSQLError struct {
	Code         int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	ExtendedCode int32  `protobuf:"varint,2,opt,name=extended_code,json=extendedCode,proto3" json:"extended_code,omitempty"`
	Err          string `protobuf:"bytes,3,opt,name=err,proto3" json:"err,omitempty"`
	// contains filtered or unexported fields
}

func (*ResponseSQLError) Descriptor deprecated

func (*ResponseSQLError) Descriptor() ([]byte, []int)

Deprecated: Use ResponseSQLError.ProtoReflect.Descriptor instead.

func (*ResponseSQLError) Error

func (sqle *ResponseSQLError) Error() string

func (*ResponseSQLError) GetCode

func (x *ResponseSQLError) GetCode() int32

func (*ResponseSQLError) GetErr

func (x *ResponseSQLError) GetErr() string

func (*ResponseSQLError) GetExtendedCode

func (x *ResponseSQLError) GetExtendedCode() int32

func (*ResponseSQLError) ProtoMessage

func (*ResponseSQLError) ProtoMessage()

func (*ResponseSQLError) ProtoReflect

func (x *ResponseSQLError) ProtoReflect() protoreflect.Message

func (*ResponseSQLError) Reset

func (x *ResponseSQLError) Reset()

func (*ResponseSQLError) String

func (x *ResponseSQLError) String() string

type ResponseStmtClose

type ResponseStmtClose struct {
	// contains filtered or unexported fields
}

func (*ResponseStmtClose) Descriptor deprecated

func (*ResponseStmtClose) Descriptor() ([]byte, []int)

Deprecated: Use ResponseStmtClose.ProtoReflect.Descriptor instead.

func (*ResponseStmtClose) ProtoMessage

func (*ResponseStmtClose) ProtoMessage()

func (*ResponseStmtClose) ProtoReflect

func (x *ResponseStmtClose) ProtoReflect() protoreflect.Message

func (*ResponseStmtClose) Reset

func (x *ResponseStmtClose) Reset()

func (*ResponseStmtClose) String

func (x *ResponseStmtClose) String() string

type SQLClient

type SQLClient interface {
	Conn(ctx context.Context, opts ...grpc.CallOption) (SQL_ConnClient, error)
}

SQLClient is the client API for SQL service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewSQLClient

func NewSQLClient(cc grpc.ClientConnInterface) SQLClient

type SQLServer

type SQLServer interface {
	Conn(SQL_ConnServer) error
	// contains filtered or unexported methods
}

SQLServer is the server API for SQL service. All implementations must embed UnimplementedSQLServer for forward compatibility

type SQL_ConnClient

type SQL_ConnClient interface {
	Send(*Request) error
	Recv() (*Response, error)
	grpc.ClientStream
}

type SQL_ConnServer

type SQL_ConnServer interface {
	Send(*Response) error
	Recv() (*Request, error)
	grpc.ServerStream
}

type UnimplementedSQLServer

type UnimplementedSQLServer struct {
}

UnimplementedSQLServer must be embedded to have forward compatible implementations.

func (UnimplementedSQLServer) Conn

type UnsafeSQLServer

type UnsafeSQLServer interface {
	// contains filtered or unexported methods
}

UnsafeSQLServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SQLServer will result in compilation errors.

type Value

type Value struct {
	Code    ValueCode `protobuf:"varint,1,opt,name=code,proto3,enum=protocol.ValueCode" json:"code,omitempty"` // Code identifying the type of the value, see below.
	Text    string    `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	Int64   int64     `protobuf:"varint,3,opt,name=int64,proto3" json:"int64,omitempty"`
	Float64 float64   `protobuf:"fixed64,4,opt,name=float64,proto3" json:"float64,omitempty"`
	Bytes   []byte    `protobuf:"bytes,5,opt,name=bytes,proto3" json:"bytes,omitempty"`
	Time    int64     `protobuf:"varint,6,opt,name=time,proto3" json:"time,omitempty"`
	Bool    bool      `protobuf:"varint,7,opt,name=bool,proto3" json:"bool,omitempty"`
	// contains filtered or unexported fields
}

Value of a single statement argument or row column.

func FromDriverValues

func FromDriverValues(objects []driver.Value) ([]*Value, error)

FromDriverValues converts a slice of Go driver.Value objects of supported types to a slice of protobuf Value objects.

func ToValueSlice

func ToValueSlice(objects []interface{}) ([]Value, error)

ToValueSlice converts a slice of Go objects of supported types to a slice of protobuf Value objects.

func (*Value) Descriptor deprecated

func (*Value) Descriptor() ([]byte, []int)

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetBool

func (x *Value) GetBool() bool

func (*Value) GetBytes

func (x *Value) GetBytes() []byte

func (*Value) GetCode

func (x *Value) GetCode() ValueCode

func (*Value) GetFloat64

func (x *Value) GetFloat64() float64

func (*Value) GetInt64

func (x *Value) GetInt64() int64

func (*Value) GetText

func (x *Value) GetText() string

func (*Value) GetTime

func (x *Value) GetTime() int64

func (*Value) Interface

func (v *Value) Interface() interface{}

Interface implements valueMessage.

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

func (x *Value) ProtoReflect() protoreflect.Message

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

type ValueCode

type ValueCode int32

ValueCode is a numberic code identifying the Go type of a value.

It supports all types that should be handle by driver.Value in database/sql/driver.

const (
	ValueCode_INT64   ValueCode = 0
	ValueCode_FLOAT64 ValueCode = 1
	ValueCode_BOOL    ValueCode = 2
	ValueCode_BYTES   ValueCode = 3
	ValueCode_STRING  ValueCode = 4
	ValueCode_TIME    ValueCode = 5
	ValueCode_NULL    ValueCode = 6
)

func ToValueCode

func ToValueCode(t reflect.Type) ValueCode

ToValueCode converts a Go type object into its serialized code number.

func (ValueCode) Descriptor

func (ValueCode) Descriptor() protoreflect.EnumDescriptor

func (ValueCode) Enum

func (x ValueCode) Enum() *ValueCode

func (ValueCode) EnumDescriptor deprecated

func (ValueCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use ValueCode.Descriptor instead.

func (ValueCode) Number

func (x ValueCode) Number() protoreflect.EnumNumber

func (ValueCode) String

func (x ValueCode) String() string

func (ValueCode) Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL