Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultPoolSize = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
type Config ¶
type Config struct {
ConnectionString string `json:"connection_string"`
PoolSize int `json:"pool_size"`
StatementTimeout time.Duration `json:"statement_timeout"`
// ReadOnly disables postgresql_execute entirely and forces every
// postgresql_query call to run inside a real "BEGIN ... READ ONLY"
// transaction, rolled back afterwards. Defaults to true: the server
// only becomes able to mutate data when an operator explicitly opts
// out via LEANPROXY_POSTGRES_READ_ONLY=false.
ReadOnly bool `json:"read_only"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type ExecuteResult ¶
type PostgresClient ¶
type PostgresClient struct {
// contains filtered or unexported fields
}
func NewPostgresClient ¶
func NewPostgresClient(logger *slog.Logger, cfg Config) (*PostgresClient, error)
func (*PostgresClient) CallTool ¶
func (c *PostgresClient) CallTool(ctx context.Context, name string, args json.RawMessage) (interface{}, error)
func (*PostgresClient) Close ¶
func (c *PostgresClient) Close()
func (*PostgresClient) GetTools ¶
func (c *PostgresClient) GetTools() []ToolDefinition
type QueryResult ¶
type ToolDefinition ¶
type ToolDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema json.RawMessage `json:"inputSchema"`
}
type ToolHandler ¶
type ToolHandler func(ctx context.Context, args json.RawMessage) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.