Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDatabaseServiceServer(s grpc.ServiceRegistrar, srv DatabaseServiceServer)
- type Data
- type DatabaseServiceClient
- type DatabaseServiceServer
- type DatabaseService_QueryClient
- type DatabaseService_QueryServer
- type NamedValue
- func (*NamedValue) Descriptor() ([]byte, []int)deprecated
- func (x *NamedValue) GetName() string
- func (x *NamedValue) GetOrdinal() int64
- func (x *NamedValue) GetValue() *anypb.Any
- func (*NamedValue) ProtoMessage()
- func (x *NamedValue) ProtoReflect() protoreflect.Message
- func (x *NamedValue) Reset()
- func (x *NamedValue) String() string
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetParams() []*NamedValue
- func (x *QueryRequest) GetReplicationId() string
- func (x *QueryRequest) GetSql() string
- func (x *QueryRequest) GetType() QueryType
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) String() string
- type QueryResponse
- func (*QueryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryResponse) GetError() string
- func (x *QueryResponse) GetLastInsertId() int64
- func (x *QueryResponse) GetResultSet() *Data
- func (x *QueryResponse) GetRowsAffected() int64
- func (x *QueryResponse) GetTxseq() uint64
- func (*QueryResponse) ProtoMessage()
- func (x *QueryResponse) ProtoReflect() protoreflect.Message
- func (x *QueryResponse) Reset()
- func (x *QueryResponse) String() string
- type QueryType
- type Row
- type UnimplementedDatabaseServiceServer
- type UnsafeDatabaseServiceServer
Constants ¶
const (
DatabaseService_Query_FullMethodName = "/sql.v1.DatabaseService/Query"
)
Variables ¶
var ( QueryType_name = map[int32]string{ 0: "QUERY_TYPE_UNSPECIFIED", 1: "QUERY_TYPE_EXEC", } QueryType_value = map[string]int32{ "QUERY_TYPE_UNSPECIFIED": 0, "QUERY_TYPE_EXEC": 1, } )
Enum value maps for QueryType.
var DatabaseService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "sql.v1.DatabaseService", HandlerType: (*DatabaseServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Query", Handler: _DatabaseService_Query_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "sql/v1/sql.proto", }
DatabaseService_ServiceDesc is the grpc.ServiceDesc for DatabaseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_sql_v1_sql_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDatabaseServiceServer ¶
func RegisterDatabaseServiceServer(s grpc.ServiceRegistrar, srv DatabaseServiceServer)
Types ¶
type Data ¶
type Data struct {
Columns []string `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"`
Rows []*Row `protobuf:"bytes,2,rep,name=rows,proto3" json:"rows,omitempty"`
// contains filtered or unexported fields
}
func (*Data) Descriptor
deprecated
func (*Data) GetColumns ¶
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type DatabaseServiceClient ¶
type DatabaseServiceClient interface {
Query(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[QueryRequest, QueryResponse], error)
}
DatabaseServiceClient is the client API for DatabaseService 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 NewDatabaseServiceClient ¶
func NewDatabaseServiceClient(cc grpc.ClientConnInterface) DatabaseServiceClient
type DatabaseServiceServer ¶
type DatabaseServiceServer interface {
Query(grpc.BidiStreamingServer[QueryRequest, QueryResponse]) error
// contains filtered or unexported methods
}
DatabaseServiceServer is the server API for DatabaseService service. All implementations must embed UnimplementedDatabaseServiceServer for forward compatibility.
type DatabaseService_QueryClient ¶
type DatabaseService_QueryClient = grpc.BidiStreamingClient[QueryRequest, QueryResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type DatabaseService_QueryServer ¶
type DatabaseService_QueryServer = grpc.BidiStreamingServer[QueryRequest, QueryResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type NamedValue ¶
type NamedValue struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Ordinal int64 `protobuf:"varint,2,opt,name=ordinal,proto3" json:"ordinal,omitempty"`
Value *anypb.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*NamedValue) Descriptor
deprecated
func (*NamedValue) Descriptor() ([]byte, []int)
Deprecated: Use NamedValue.ProtoReflect.Descriptor instead.
func (*NamedValue) GetName ¶
func (x *NamedValue) GetName() string
func (*NamedValue) GetOrdinal ¶
func (x *NamedValue) GetOrdinal() int64
func (*NamedValue) GetValue ¶
func (x *NamedValue) GetValue() *anypb.Any
func (*NamedValue) ProtoMessage ¶
func (*NamedValue) ProtoMessage()
func (*NamedValue) ProtoReflect ¶
func (x *NamedValue) ProtoReflect() protoreflect.Message
func (*NamedValue) Reset ¶
func (x *NamedValue) Reset()
func (*NamedValue) String ¶
func (x *NamedValue) String() string
type QueryRequest ¶
type QueryRequest struct {
Type QueryType `protobuf:"varint,1,opt,name=type,proto3,enum=sql.v1.QueryType" json:"type,omitempty"`
Sql string `protobuf:"bytes,2,opt,name=sql,proto3" json:"sql,omitempty"`
Params []*NamedValue `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty"`
ReplicationId string `protobuf:"bytes,4,opt,name=replication_id,json=replicationId,proto3" json:"replication_id,omitempty"`
// contains filtered or unexported fields
}
func (*QueryRequest) Descriptor
deprecated
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetParams ¶
func (x *QueryRequest) GetParams() []*NamedValue
func (*QueryRequest) GetReplicationId ¶
func (x *QueryRequest) GetReplicationId() string
func (*QueryRequest) GetSql ¶
func (x *QueryRequest) GetSql() string
func (*QueryRequest) GetType ¶
func (x *QueryRequest) GetType() QueryType
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶
func (x *QueryRequest) String() string
type QueryResponse ¶
type QueryResponse struct {
ResultSet *Data `protobuf:"bytes,1,opt,name=result_set,json=resultSet,proto3" json:"result_set,omitempty"`
RowsAffected int64 `protobuf:"varint,2,opt,name=rows_affected,json=rowsAffected,proto3" json:"rows_affected,omitempty"`
LastInsertId int64 `protobuf:"varint,3,opt,name=last_insert_id,json=lastInsertId,proto3" json:"last_insert_id,omitempty"`
Txseq uint64 `protobuf:"varint,4,opt,name=txseq,proto3" json:"txseq,omitempty"`
Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*QueryResponse) Descriptor
deprecated
func (*QueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) GetError ¶
func (x *QueryResponse) GetError() string
func (*QueryResponse) GetLastInsertId ¶
func (x *QueryResponse) GetLastInsertId() int64
func (*QueryResponse) GetResultSet ¶
func (x *QueryResponse) GetResultSet() *Data
func (*QueryResponse) GetRowsAffected ¶
func (x *QueryResponse) GetRowsAffected() int64
func (*QueryResponse) GetTxseq ¶
func (x *QueryResponse) GetTxseq() uint64
func (*QueryResponse) ProtoMessage ¶
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) ProtoReflect ¶
func (x *QueryResponse) ProtoReflect() protoreflect.Message
func (*QueryResponse) Reset ¶
func (x *QueryResponse) Reset()
func (*QueryResponse) String ¶
func (x *QueryResponse) String() string
type QueryType ¶
type QueryType int32
func (QueryType) Descriptor ¶
func (QueryType) Descriptor() protoreflect.EnumDescriptor
func (QueryType) EnumDescriptor
deprecated
func (QueryType) Number ¶
func (x QueryType) Number() protoreflect.EnumNumber
func (QueryType) Type ¶
func (QueryType) Type() protoreflect.EnumType
type Row ¶
type Row struct {
Values []*anypb.Any `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
// contains filtered or unexported fields
}
func (*Row) Descriptor
deprecated
func (*Row) ProtoMessage ¶
func (*Row) ProtoMessage()
func (*Row) ProtoReflect ¶
func (x *Row) ProtoReflect() protoreflect.Message
type UnimplementedDatabaseServiceServer ¶
type UnimplementedDatabaseServiceServer struct{}
UnimplementedDatabaseServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
type UnsafeDatabaseServiceServer ¶
type UnsafeDatabaseServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDatabaseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DatabaseServiceServer will result in compilation errors.