Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatabaseExecuteTool ¶
func NewDatabaseExecuteTool(db *gorm.DB, opts ...Option) tool.InvokableTool
NewDatabaseExecuteTool 创建执行核心工具实例
Types ¶
type DatabaseExecuteTool ¶
type DatabaseExecuteTool struct {
// contains filtered or unexported fields
}
DatabaseExecuteTool 数据库执行工具
type ExecuteParams ¶
type ExecuteParams struct {
Query string `json:"query" jsonschema:"description=要执行的SQL查询语句,required"`
Params []interface{} `json:"params,omitempty" jsonschema:"description=查询参数(可选)"`
}
ExecuteParams 查询参数
type Option ¶ added in v0.3.0
type Option func(*DatabaseExecuteTool)
Option configures the database execution tool.
func WithAllowWrite ¶ added in v0.3.0
WithAllowWrite explicitly permits INSERT/UPDATE/DELETE/DDL statements. The tool is read-only by default.
func WithMaxResultRows ¶ added in v0.3.0
WithMaxResultRows caps SELECT-like result sets.
func WithTimeout ¶ added in v0.3.0
WithTimeout adds a timeout around each SQL execution when positive.
Click to show internal directories.
Click to hide internal directories.