queryservicev18connect

package
v0.0.0-...-770e144 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QueryExecuteProcedure is the fully-qualified name of the Query's Execute RPC.
	QueryExecuteProcedure = "/queryservice.Query/Execute"
	// QueryStreamExecuteProcedure is the fully-qualified name of the Query's StreamExecute RPC.
	QueryStreamExecuteProcedure = "/queryservice.Query/StreamExecute"
	// QueryBeginProcedure is the fully-qualified name of the Query's Begin RPC.
	QueryBeginProcedure = "/queryservice.Query/Begin"
	// QueryCommitProcedure is the fully-qualified name of the Query's Commit RPC.
	QueryCommitProcedure = "/queryservice.Query/Commit"
	// QueryRollbackProcedure is the fully-qualified name of the Query's Rollback RPC.
	QueryRollbackProcedure = "/queryservice.Query/Rollback"
	// QueryPrepareProcedure is the fully-qualified name of the Query's Prepare RPC.
	QueryPrepareProcedure = "/queryservice.Query/Prepare"
	// QueryCommitPreparedProcedure is the fully-qualified name of the Query's CommitPrepared RPC.
	QueryCommitPreparedProcedure = "/queryservice.Query/CommitPrepared"
	// QueryRollbackPreparedProcedure is the fully-qualified name of the Query's RollbackPrepared RPC.
	QueryRollbackPreparedProcedure = "/queryservice.Query/RollbackPrepared"
	// QueryCreateTransactionProcedure is the fully-qualified name of the Query's CreateTransaction RPC.
	QueryCreateTransactionProcedure = "/queryservice.Query/CreateTransaction"
	// QueryStartCommitProcedure is the fully-qualified name of the Query's StartCommit RPC.
	QueryStartCommitProcedure = "/queryservice.Query/StartCommit"
	// QuerySetRollbackProcedure is the fully-qualified name of the Query's SetRollback RPC.
	QuerySetRollbackProcedure = "/queryservice.Query/SetRollback"
	// QueryConcludeTransactionProcedure is the fully-qualified name of the Query's ConcludeTransaction
	// RPC.
	QueryConcludeTransactionProcedure = "/queryservice.Query/ConcludeTransaction"
	// QueryReadTransactionProcedure is the fully-qualified name of the Query's ReadTransaction RPC.
	QueryReadTransactionProcedure = "/queryservice.Query/ReadTransaction"
	// QueryBeginExecuteProcedure is the fully-qualified name of the Query's BeginExecute RPC.
	QueryBeginExecuteProcedure = "/queryservice.Query/BeginExecute"
	// QueryBeginStreamExecuteProcedure is the fully-qualified name of the Query's BeginStreamExecute
	// RPC.
	QueryBeginStreamExecuteProcedure = "/queryservice.Query/BeginStreamExecute"
	// QueryMessageStreamProcedure is the fully-qualified name of the Query's MessageStream RPC.
	QueryMessageStreamProcedure = "/queryservice.Query/MessageStream"
	// QueryMessageAckProcedure is the fully-qualified name of the Query's MessageAck RPC.
	QueryMessageAckProcedure = "/queryservice.Query/MessageAck"
	// QueryReserveExecuteProcedure is the fully-qualified name of the Query's ReserveExecute RPC.
	QueryReserveExecuteProcedure = "/queryservice.Query/ReserveExecute"
	// QueryReserveBeginExecuteProcedure is the fully-qualified name of the Query's ReserveBeginExecute
	// RPC.
	QueryReserveBeginExecuteProcedure = "/queryservice.Query/ReserveBeginExecute"
	// QueryReserveStreamExecuteProcedure is the fully-qualified name of the Query's
	// ReserveStreamExecute RPC.
	QueryReserveStreamExecuteProcedure = "/queryservice.Query/ReserveStreamExecute"
	// QueryReserveBeginStreamExecuteProcedure is the fully-qualified name of the Query's
	// ReserveBeginStreamExecute RPC.
	QueryReserveBeginStreamExecuteProcedure = "/queryservice.Query/ReserveBeginStreamExecute"
	// QueryReleaseProcedure is the fully-qualified name of the Query's Release RPC.
	QueryReleaseProcedure = "/queryservice.Query/Release"
	// QueryStreamHealthProcedure is the fully-qualified name of the Query's StreamHealth RPC.
	QueryStreamHealthProcedure = "/queryservice.Query/StreamHealth"
	// QueryVStreamProcedure is the fully-qualified name of the Query's VStream RPC.
	QueryVStreamProcedure = "/queryservice.Query/VStream"
	// QueryVStreamRowsProcedure is the fully-qualified name of the Query's VStreamRows RPC.
	QueryVStreamRowsProcedure = "/queryservice.Query/VStreamRows"
	// QueryVStreamTablesProcedure is the fully-qualified name of the Query's VStreamTables RPC.
	QueryVStreamTablesProcedure = "/queryservice.Query/VStreamTables"
	// QueryVStreamResultsProcedure is the fully-qualified name of the Query's VStreamResults RPC.
	QueryVStreamResultsProcedure = "/queryservice.Query/VStreamResults"
	// QueryGetSchemaProcedure is the fully-qualified name of the Query's GetSchema RPC.
	QueryGetSchemaProcedure = "/queryservice.Query/GetSchema"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// QueryName is the fully-qualified name of the Query service.
	QueryName = "queryservice.Query"
)

Variables

This section is empty.

Functions

func NewQueryHandler

func NewQueryHandler(svc QueryHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewQueryHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type QueryClient

type QueryClient interface {
	// Execute executes the specified SQL query (might be in a
	// transaction context, if Query.transaction_id is set).
	Execute(context.Context, *connect.Request[v18.ExecuteRequest]) (*connect.Response[v18.ExecuteResponse], error)
	// StreamExecute executes a streaming query. Use this method if the
	// query returns a large number of rows. The first QueryResult will
	// contain the Fields, subsequent QueryResult messages will contain
	// the rows.
	StreamExecute(context.Context, *connect.Request[v18.StreamExecuteRequest]) (*connect.ServerStreamForClient[v18.StreamExecuteResponse], error)
	// Begin a transaction.
	Begin(context.Context, *connect.Request[v18.BeginRequest]) (*connect.Response[v18.BeginResponse], error)
	// Commit a transaction.
	Commit(context.Context, *connect.Request[v18.CommitRequest]) (*connect.Response[v18.CommitResponse], error)
	// Rollback a transaction.
	Rollback(context.Context, *connect.Request[v18.RollbackRequest]) (*connect.Response[v18.RollbackResponse], error)
	// Prepare preares a transaction.
	Prepare(context.Context, *connect.Request[v18.PrepareRequest]) (*connect.Response[v18.PrepareResponse], error)
	// CommitPrepared commits a prepared transaction.
	CommitPrepared(context.Context, *connect.Request[v18.CommitPreparedRequest]) (*connect.Response[v18.CommitPreparedResponse], error)
	// RollbackPrepared rolls back a prepared transaction.
	RollbackPrepared(context.Context, *connect.Request[v18.RollbackPreparedRequest]) (*connect.Response[v18.RollbackPreparedResponse], error)
	// CreateTransaction creates the metadata for a 2pc transaction.
	CreateTransaction(context.Context, *connect.Request[v18.CreateTransactionRequest]) (*connect.Response[v18.CreateTransactionResponse], error)
	// StartCommit initiates a commit for a 2pc transaction.
	StartCommit(context.Context, *connect.Request[v18.StartCommitRequest]) (*connect.Response[v18.StartCommitResponse], error)
	// SetRollback marks the 2pc transaction for rollback.
	SetRollback(context.Context, *connect.Request[v18.SetRollbackRequest]) (*connect.Response[v18.SetRollbackResponse], error)
	// ConcludeTransaction marks the 2pc transaction as resolved.
	ConcludeTransaction(context.Context, *connect.Request[v18.ConcludeTransactionRequest]) (*connect.Response[v18.ConcludeTransactionResponse], error)
	// ReadTransaction returns the 2pc transaction info.
	ReadTransaction(context.Context, *connect.Request[v18.ReadTransactionRequest]) (*connect.Response[v18.ReadTransactionResponse], error)
	// BeginExecute executes a begin and the specified SQL query.
	BeginExecute(context.Context, *connect.Request[v18.BeginExecuteRequest]) (*connect.Response[v18.BeginExecuteResponse], error)
	// BeginStreamExecute executes a begin and the specified SQL query.
	BeginStreamExecute(context.Context, *connect.Request[v18.BeginStreamExecuteRequest]) (*connect.ServerStreamForClient[v18.BeginStreamExecuteResponse], error)
	// MessageStream streams messages from a message table.
	MessageStream(context.Context, *connect.Request[v18.MessageStreamRequest]) (*connect.ServerStreamForClient[v18.MessageStreamResponse], error)
	// MessageAck acks messages for a table.
	MessageAck(context.Context, *connect.Request[v18.MessageAckRequest]) (*connect.Response[v18.MessageAckResponse], error)
	// ReserveExecute executes a query on a reserved connection
	ReserveExecute(context.Context, *connect.Request[v18.ReserveExecuteRequest]) (*connect.Response[v18.ReserveExecuteResponse], error)
	// ReserveBeginExecute starts a transaction and executes a query in the transaction on a reserved connection
	ReserveBeginExecute(context.Context, *connect.Request[v18.ReserveBeginExecuteRequest]) (*connect.Response[v18.ReserveBeginExecuteResponse], error)
	// ReserveStreamExecute executes a streaming query on a reserved connection
	ReserveStreamExecute(context.Context, *connect.Request[v18.ReserveStreamExecuteRequest]) (*connect.ServerStreamForClient[v18.ReserveStreamExecuteResponse], error)
	// ReserveBeginStreamExecute starts a transaction and executes a streaming query in the transaction on a reserved connection
	ReserveBeginStreamExecute(context.Context, *connect.Request[v18.ReserveBeginStreamExecuteRequest]) (*connect.ServerStreamForClient[v18.ReserveBeginStreamExecuteResponse], error)
	// Release releases the connection
	Release(context.Context, *connect.Request[v18.ReleaseRequest]) (*connect.Response[v18.ReleaseResponse], error)
	// StreamHealth runs a streaming RPC to the tablet, that returns the
	// current health of the tablet on a regular basis.
	StreamHealth(context.Context, *connect.Request[v18.StreamHealthRequest]) (*connect.ServerStreamForClient[v18.StreamHealthResponse], error)
	// VStream streams vreplication events.
	VStream(context.Context, *connect.Request[v181.VStreamRequest]) (*connect.ServerStreamForClient[v181.VStreamResponse], error)
	// VStreamRows streams rows from the specified starting point.
	VStreamRows(context.Context, *connect.Request[v181.VStreamRowsRequest]) (*connect.ServerStreamForClient[v181.VStreamRowsResponse], error)
	// VStreamTables streams rows from the specified starting point.
	VStreamTables(context.Context, *connect.Request[v181.VStreamTablesRequest]) (*connect.ServerStreamForClient[v181.VStreamTablesResponse], error)
	// VStreamResults streams results along with the gtid of the snapshot.
	VStreamResults(context.Context, *connect.Request[v181.VStreamResultsRequest]) (*connect.ServerStreamForClient[v181.VStreamResultsResponse], error)
	// GetSchema returns the schema information.
	GetSchema(context.Context, *connect.Request[v18.GetSchemaRequest]) (*connect.ServerStreamForClient[v18.GetSchemaResponse], error)
}

QueryClient is a client for the queryservice.Query service.

func NewQueryClient

func NewQueryClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) QueryClient

NewQueryClient constructs a client for the queryservice.Query service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type QueryHandler

type QueryHandler interface {
	// Execute executes the specified SQL query (might be in a
	// transaction context, if Query.transaction_id is set).
	Execute(context.Context, *connect.Request[v18.ExecuteRequest]) (*connect.Response[v18.ExecuteResponse], error)
	// StreamExecute executes a streaming query. Use this method if the
	// query returns a large number of rows. The first QueryResult will
	// contain the Fields, subsequent QueryResult messages will contain
	// the rows.
	StreamExecute(context.Context, *connect.Request[v18.StreamExecuteRequest], *connect.ServerStream[v18.StreamExecuteResponse]) error
	// Begin a transaction.
	Begin(context.Context, *connect.Request[v18.BeginRequest]) (*connect.Response[v18.BeginResponse], error)
	// Commit a transaction.
	Commit(context.Context, *connect.Request[v18.CommitRequest]) (*connect.Response[v18.CommitResponse], error)
	// Rollback a transaction.
	Rollback(context.Context, *connect.Request[v18.RollbackRequest]) (*connect.Response[v18.RollbackResponse], error)
	// Prepare preares a transaction.
	Prepare(context.Context, *connect.Request[v18.PrepareRequest]) (*connect.Response[v18.PrepareResponse], error)
	// CommitPrepared commits a prepared transaction.
	CommitPrepared(context.Context, *connect.Request[v18.CommitPreparedRequest]) (*connect.Response[v18.CommitPreparedResponse], error)
	// RollbackPrepared rolls back a prepared transaction.
	RollbackPrepared(context.Context, *connect.Request[v18.RollbackPreparedRequest]) (*connect.Response[v18.RollbackPreparedResponse], error)
	// CreateTransaction creates the metadata for a 2pc transaction.
	CreateTransaction(context.Context, *connect.Request[v18.CreateTransactionRequest]) (*connect.Response[v18.CreateTransactionResponse], error)
	// StartCommit initiates a commit for a 2pc transaction.
	StartCommit(context.Context, *connect.Request[v18.StartCommitRequest]) (*connect.Response[v18.StartCommitResponse], error)
	// SetRollback marks the 2pc transaction for rollback.
	SetRollback(context.Context, *connect.Request[v18.SetRollbackRequest]) (*connect.Response[v18.SetRollbackResponse], error)
	// ConcludeTransaction marks the 2pc transaction as resolved.
	ConcludeTransaction(context.Context, *connect.Request[v18.ConcludeTransactionRequest]) (*connect.Response[v18.ConcludeTransactionResponse], error)
	// ReadTransaction returns the 2pc transaction info.
	ReadTransaction(context.Context, *connect.Request[v18.ReadTransactionRequest]) (*connect.Response[v18.ReadTransactionResponse], error)
	// BeginExecute executes a begin and the specified SQL query.
	BeginExecute(context.Context, *connect.Request[v18.BeginExecuteRequest]) (*connect.Response[v18.BeginExecuteResponse], error)
	// BeginStreamExecute executes a begin and the specified SQL query.
	BeginStreamExecute(context.Context, *connect.Request[v18.BeginStreamExecuteRequest], *connect.ServerStream[v18.BeginStreamExecuteResponse]) error
	// MessageStream streams messages from a message table.
	MessageStream(context.Context, *connect.Request[v18.MessageStreamRequest], *connect.ServerStream[v18.MessageStreamResponse]) error
	// MessageAck acks messages for a table.
	MessageAck(context.Context, *connect.Request[v18.MessageAckRequest]) (*connect.Response[v18.MessageAckResponse], error)
	// ReserveExecute executes a query on a reserved connection
	ReserveExecute(context.Context, *connect.Request[v18.ReserveExecuteRequest]) (*connect.Response[v18.ReserveExecuteResponse], error)
	// ReserveBeginExecute starts a transaction and executes a query in the transaction on a reserved connection
	ReserveBeginExecute(context.Context, *connect.Request[v18.ReserveBeginExecuteRequest]) (*connect.Response[v18.ReserveBeginExecuteResponse], error)
	// ReserveStreamExecute executes a streaming query on a reserved connection
	ReserveStreamExecute(context.Context, *connect.Request[v18.ReserveStreamExecuteRequest], *connect.ServerStream[v18.ReserveStreamExecuteResponse]) error
	// ReserveBeginStreamExecute starts a transaction and executes a streaming query in the transaction on a reserved connection
	ReserveBeginStreamExecute(context.Context, *connect.Request[v18.ReserveBeginStreamExecuteRequest], *connect.ServerStream[v18.ReserveBeginStreamExecuteResponse]) error
	// Release releases the connection
	Release(context.Context, *connect.Request[v18.ReleaseRequest]) (*connect.Response[v18.ReleaseResponse], error)
	// StreamHealth runs a streaming RPC to the tablet, that returns the
	// current health of the tablet on a regular basis.
	StreamHealth(context.Context, *connect.Request[v18.StreamHealthRequest], *connect.ServerStream[v18.StreamHealthResponse]) error
	// VStream streams vreplication events.
	VStream(context.Context, *connect.Request[v181.VStreamRequest], *connect.ServerStream[v181.VStreamResponse]) error
	// VStreamRows streams rows from the specified starting point.
	VStreamRows(context.Context, *connect.Request[v181.VStreamRowsRequest], *connect.ServerStream[v181.VStreamRowsResponse]) error
	// VStreamTables streams rows from the specified starting point.
	VStreamTables(context.Context, *connect.Request[v181.VStreamTablesRequest], *connect.ServerStream[v181.VStreamTablesResponse]) error
	// VStreamResults streams results along with the gtid of the snapshot.
	VStreamResults(context.Context, *connect.Request[v181.VStreamResultsRequest], *connect.ServerStream[v181.VStreamResultsResponse]) error
	// GetSchema returns the schema information.
	GetSchema(context.Context, *connect.Request[v18.GetSchemaRequest], *connect.ServerStream[v18.GetSchemaResponse]) error
}

QueryHandler is an implementation of the queryservice.Query service.

type UnimplementedQueryHandler

type UnimplementedQueryHandler struct{}

UnimplementedQueryHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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