/* Copyright 2019 The Vitess Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // This file contains the service VtTablet exposes for queries. syntax = "proto3"; package queryservice; option go_package = "vitess.io/vitess/go/vt/proto/queryservice"; import "query.proto"; import "binlogdata.proto"; // Query defines the tablet query service, implemented by vttablet. service Query { // Execute executes the specified SQL query (might be in a // transaction context, if Query.transaction_id is set). rpc Execute(query.ExecuteRequest) returns (query.ExecuteResponse) {}; // 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. rpc StreamExecute(query.StreamExecuteRequest) returns (stream query.StreamExecuteResponse) {}; // Begin a transaction. rpc Begin(query.BeginRequest) returns (query.BeginResponse) {}; // Commit a transaction. rpc Commit(query.CommitRequest) returns (query.CommitResponse) {}; // Rollback a transaction. rpc Rollback(query.RollbackRequest) returns (query.RollbackResponse) {}; // Prepare preares a transaction. rpc Prepare(query.PrepareRequest) returns (query.PrepareResponse) {}; // CommitPrepared commits a prepared transaction. rpc CommitPrepared(query.CommitPreparedRequest) returns (query.CommitPreparedResponse) {}; // RollbackPrepared rolls back a prepared transaction. rpc RollbackPrepared(query.RollbackPreparedRequest) returns (query.RollbackPreparedResponse) {}; // CreateTransaction creates the metadata for a 2pc transaction. rpc CreateTransaction(query.CreateTransactionRequest) returns (query.CreateTransactionResponse) {}; // StartCommit initiates a commit for a 2pc transaction. rpc StartCommit(query.StartCommitRequest) returns (query.StartCommitResponse) {}; // SetRollback marks the 2pc transaction for rollback. rpc SetRollback(query.SetRollbackRequest) returns (query.SetRollbackResponse) {}; // ConcludeTransaction marks the 2pc transaction as resolved. rpc ConcludeTransaction(query.ConcludeTransactionRequest) returns (query.ConcludeTransactionResponse) {}; // ReadTransaction returns the 2pc transaction info. rpc ReadTransaction(query.ReadTransactionRequest) returns (query.ReadTransactionResponse) {}; // BeginExecute executes a begin and the specified SQL query. rpc BeginExecute(query.BeginExecuteRequest) returns (query.BeginExecuteResponse) {}; // BeginStreamExecute executes a begin and the specified SQL query. rpc BeginStreamExecute(query.BeginStreamExecuteRequest) returns (stream query.BeginStreamExecuteResponse) {}; // MessageStream streams messages from a message table. rpc MessageStream(query.MessageStreamRequest) returns (stream query.MessageStreamResponse) {}; // MessageAck acks messages for a table. rpc MessageAck(query.MessageAckRequest) returns (query.MessageAckResponse) {}; // ReserveExecute executes a query on a reserved connection rpc ReserveExecute(query.ReserveExecuteRequest) returns (query.ReserveExecuteResponse) {}; // ReserveBeginExecute starts a transaction and executes a query in the transaction on a reserved connection rpc ReserveBeginExecute(query.ReserveBeginExecuteRequest) returns (query.ReserveBeginExecuteResponse) {}; // ReserveStreamExecute executes a streaming query on a reserved connection rpc ReserveStreamExecute(query.ReserveStreamExecuteRequest) returns (stream query.ReserveStreamExecuteResponse) {}; // ReserveBeginStreamExecute starts a transaction and executes a streaming query in the transaction on a reserved connection rpc ReserveBeginStreamExecute(query.ReserveBeginStreamExecuteRequest) returns (stream query.ReserveBeginStreamExecuteResponse) {}; // Release releases the connection rpc Release(query.ReleaseRequest) returns (query.ReleaseResponse) {}; // StreamHealth runs a streaming RPC to the tablet, that returns the // current health of the tablet on a regular basis. rpc StreamHealth(query.StreamHealthRequest) returns (stream query.StreamHealthResponse) {}; // VStream streams vreplication events. rpc VStream(binlogdata.VStreamRequest) returns (stream binlogdata.VStreamResponse) {}; // VStreamRows streams rows from the specified starting point. rpc VStreamRows(binlogdata.VStreamRowsRequest) returns (stream binlogdata.VStreamRowsResponse) {}; // VStreamTables streams rows from the specified starting point. rpc VStreamTables(binlogdata.VStreamTablesRequest) returns (stream binlogdata.VStreamTablesResponse) {}; // VStreamResults streams results along with the gtid of the snapshot. rpc VStreamResults(binlogdata.VStreamResultsRequest) returns (stream binlogdata.VStreamResultsResponse) {}; // GetSchema returns the schema information. rpc GetSchema(query.GetSchemaRequest) returns (stream query.GetSchemaResponse) {}; }