grpc_impl

package
v0.0.0-...-b8497f2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromProtoSchema

func FromProtoSchema(data string) (*models.Schema, error)

FromProtoSchema converts a proto string representation (JSON) back to a domain Schema.

func QueryToTrace

func QueryToTrace(query string) *models.SQLTrace

QueryToTrace creates a minimal SQLTrace from a query string.

func ToProtoSchema

func ToProtoSchema(s *models.Schema) (string, error)

ToProtoSchema converts a domain Schema to its proto string representation (JSON).

func TraceToQuery

func TraceToQuery(t *models.SQLTrace) string

TraceToQuery extracts the query string from a domain SQLTrace. This is a helper as SQLTrace <-> proto.SQLTrace (which is query string in TranslateQuery)

Types

type GRPCClient

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

GRPCClient is an implementation of DatabasePlugin that talks over RPC.

func (*GRPCClient) ConvertSchema

func (c *GRPCClient) ConvertSchema(schema *models.Schema) (*models.Schema, error)

func (*GRPCClient) ExecuteQuery

func (*GRPCClient) GetName

func (c *GRPCClient) GetName() string

Name implements plugins.Plugin interface (and DatabasePlugin via GetName wrapper if needed, but the interface says GetName) Wait, DatabasePlugin interface has GetName. plugins.Plugin has Name. We implement GetName for DatabasePlugin.

func (*GRPCClient) Name

func (c *GRPCClient) Name() string

Name implements plugins.Plugin interface for compatibility if needed.

func (*GRPCClient) TranslateQuery

func (c *GRPCClient) TranslateQuery(sql string) (string, error)

func (*GRPCClient) Version

func (c *GRPCClient) Version() string

Version implements plugins.Plugin interface.

type GRPCPluginImpl

type GRPCPluginImpl struct {
	plugin.Plugin
	// Impl is the actual implementation of the business logic (server side).
	Impl plugins.Plugin
}

GRPCPluginImpl implements plugin.GRPCPlugin interface. It's the bridge between Hashicorp plugin system and our gRPC implementation.

func (*GRPCPluginImpl) GRPCClient

func (p *GRPCPluginImpl) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*GRPCPluginImpl) GRPCServer

func (p *GRPCPluginImpl) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type GRPCServer

GRPCServer implements the proto.SQLTraceBenchPluginServer interface. It receives gRPC requests and forwards them to the actual implementation (plugins.Plugin).

func (*GRPCServer) ConvertSchema

func (*GRPCServer) ExecuteQuery

func (*GRPCServer) GetName

func (s *GRPCServer) GetName(ctx context.Context, req *proto.Empty) (*proto.NameResponse, error)

func (*GRPCServer) TranslateQuery

Jump to

Keyboard shortcuts

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