sql

package
v0.0.0-...-1dfe0be Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package sql provides a SQL upstream implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tool

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

Tool implements the Tool interface for a tool that executes a SQL query.

func NewTool

func NewTool(t *v1.Tool, db *sql.DB, callDef *configv1.SqlCallDefinition, policies []*configv1.CallPolicy, callID string) *Tool

NewTool creates a new SQL Tool.

t is the t. db is the db. callDef is the callDef. policies is the policies. callID is the callID.

Returns the result.

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, req *tool.ExecutionRequest) (any, error)

Execute runs the SQL query with the provided inputs.

ctx is the context for the request. req is the request object.

Returns the result. Returns an error if the operation fails.

func (*Tool) GetCacheConfig

func (t *Tool) GetCacheConfig() *configv1.CacheConfig

GetCacheConfig returns the cache configuration for the tool.

Returns the result.

func (*Tool) MCPTool

func (t *Tool) MCPTool() *mcp.Tool

MCPTool returns the MCP tool definition.

Returns the result.

func (*Tool) Tool

func (t *Tool) Tool() *v1.Tool

Tool returns the protobuf definition of the tool.

Returns the result.

type Upstream

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

Upstream implements the upstream.Upstream interface for SQL databases.

func NewUpstream

func NewUpstream() *Upstream

NewUpstream creates a new SQL upstream.

Returns the result.

func (*Upstream) Register

Register discovers and registers tools from the SQL configuration.

ctx is the context for the request. serviceConfig is the serviceConfig. toolManager is the toolManager. _ is an unused parameter. _ is an unused parameter. _ is an unused parameter.

Returns the result. Returns the result. Returns the result. Returns an error if the operation fails.

func (*Upstream) Shutdown

func (u *Upstream) Shutdown(_ context.Context) error

Shutdown closes the database connection.

_ is an unused parameter.

Returns an error if the operation fails.

Jump to

Keyboard shortcuts

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