Documentation
¶
Index ¶
- func DecodeBindVariablesBson(buf *bytes.Buffer, kind byte) (bindVars map[string]interface{})
- func DecodeResultsBson(buf *bytes.Buffer, kind byte) (results []mproto.QueryResult)
- func EncodeBindVariablesBson(buf *bytes2.ChunkedWriter, key string, bindVars map[string]interface{})
- func EncodeQueriesBson(queries []BoundQuery, key string, buf *bytes2.ChunkedWriter)
- func EncodeResultsBson(results []mproto.QueryResult, key string, buf *bytes2.ChunkedWriter)
- func RegisterAuthenticated(sqlQuery SqlQuery)
- type BoundQuery
- type ConnectionInfo
- type DDLInvalidate
- type DmlType
- type Query
- type QueryList
- type QueryResultList
- type Session
- type SessionInfo
- type SessionParams
- type SqlQuery
- type TransactionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBindVariablesBson ¶
func DecodeResultsBson ¶
func DecodeResultsBson(buf *bytes.Buffer, kind byte) (results []mproto.QueryResult)
func EncodeBindVariablesBson ¶
func EncodeBindVariablesBson(buf *bytes2.ChunkedWriter, key string, bindVars map[string]interface{})
func EncodeQueriesBson ¶
func EncodeQueriesBson(queries []BoundQuery, key string, buf *bytes2.ChunkedWriter)
func EncodeResultsBson ¶
func EncodeResultsBson(results []mproto.QueryResult, key string, buf *bytes2.ChunkedWriter)
func RegisterAuthenticated ¶
func RegisterAuthenticated(sqlQuery SqlQuery)
helper method to register the server (does interface checking)
Types ¶
type BoundQuery ¶
func DecodeQueriesBson ¶
func DecodeQueriesBson(buf *bytes.Buffer, kind byte) (queries []BoundQuery)
func (*BoundQuery) MarshalBson ¶
func (bdq *BoundQuery) MarshalBson(buf *bytes2.ChunkedWriter)
func (*BoundQuery) UnmarshalBson ¶
func (bdq *BoundQuery) UnmarshalBson(buf *bytes.Buffer)
type ConnectionInfo ¶
type ConnectionInfo struct {
ConnectionId int64
}
type DDLInvalidate ¶
type DDLInvalidate struct {
DDL string
}
type Query ¶
type Query struct { Sql string BindVariables map[string]interface{} TransactionId int64 ConnectionId int64 SessionId int64 }
func (*Query) MarshalBson ¶
func (query *Query) MarshalBson(buf *bytes2.ChunkedWriter)
func (*Query) String ¶
String prints a readable version of Query, and also truncates data if it's too long
func (*Query) UnmarshalBson ¶
type QueryList ¶
type QueryList struct { Queries []BoundQuery TransactionId int64 ConnectionId int64 SessionId int64 }
func (*QueryList) MarshalBson ¶
func (ql *QueryList) MarshalBson(buf *bytes2.ChunkedWriter)
func (*QueryList) UnmarshalBson ¶
type QueryResultList ¶
type QueryResultList struct {
List []mproto.QueryResult
}
func (*QueryResultList) MarshalBson ¶
func (qrl *QueryResultList) MarshalBson(buf *bytes2.ChunkedWriter)
func (*QueryResultList) UnmarshalBson ¶
func (qrl *QueryResultList) UnmarshalBson(buf *bytes.Buffer)
type Session ¶
func (*Session) MarshalBson ¶
func (session *Session) MarshalBson(buf *bytes2.ChunkedWriter)
func (*Session) UnmarshalBson ¶
type SessionInfo ¶
type SessionInfo struct {
SessionId int64
}
type SessionParams ¶
type SqlQuery ¶
type SqlQuery interface { GetSessionId(sessionParams *SessionParams, sessionInfo *SessionInfo) error // FIXME(sugu) Note the client will support both returning an // int64 or a structure. Using the structure will be rolled // out after the client is rolled out. Begin(context *rpcproto.Context, session *Session, txInfo *TransactionInfo) error Commit(context *rpcproto.Context, session *Session, noOutput *string) error Rollback(context *rpcproto.Context, session *Session, noOutput *string) error CreateReserved(session *Session, connectionInfo *ConnectionInfo) error CloseReserved(session *Session, noOutput *string) error Execute(context *rpcproto.Context, query *Query, reply *mproto.QueryResult) error StreamExecute(context *rpcproto.Context, query *Query, sendReply func(reply interface{}) error) error ExecuteBatch(context *rpcproto.Context, queryList *QueryList, reply *QueryResultList) error }
defines the RPC services the service name to use is 'SqlQuery'
type TransactionInfo ¶
type TransactionInfo struct {
TransactionId int64
}
Click to show internal directories.
Click to hide internal directories.