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 ¶
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.
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 ¶
func (u *Upstream) Register( ctx context.Context, serviceConfig *configv1.UpstreamServiceConfig, toolManager tool.ManagerInterface, _ prompt.ManagerInterface, _ resource.ManagerInterface, _ bool, ) (string, []*configv1.ToolDefinition, []*configv1.ResourceDefinition, error)
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.