Documentation
¶
Index ¶
- func ApplyPool(database *sql.DB, cfg PoolConfig)
- func ParseQualifiedName(input, defaultSchema string) (schema string, name string, err error)
- func Ping(ctx context.Context, database *sql.DB, timeout time.Duration) error
- func RegisterCatalogTools(srv *server.MCPServer, service CatalogService, opts ToolsetOptions)
- func RowsToMaps(rows *sql.Rows, cfg QueryLimits) ([]map[string]any, bool, error)
- func ValidateIdentifier(value string) error
- type BaseConfig
- type CatalogService
- type PoolConfig
- type QueryLimits
- type QueryResult
- type ToolsetOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPool ¶
func ApplyPool(database *sql.DB, cfg PoolConfig)
func ParseQualifiedName ¶
func RegisterCatalogTools ¶
func RegisterCatalogTools(srv *server.MCPServer, service CatalogService, opts ToolsetOptions)
func RowsToMaps ¶
func ValidateIdentifier ¶
Types ¶
type BaseConfig ¶
type BaseConfig struct {
ConnectTimeout time.Duration
QueryTimeout time.Duration
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime time.Duration
ConnMaxIdleTime time.Duration
MaxRows int
MaxBytes int
MaxCellChars int
EnableWrite bool
WriteAck string
}
func LoadBaseConfig ¶
func LoadBaseConfig(prefix string) (BaseConfig, error)
func (BaseConfig) Limits ¶
func (c BaseConfig) Limits() QueryLimits
func (BaseConfig) Pool ¶
func (c BaseConfig) Pool() PoolConfig
func (BaseConfig) ValidateWriteOptIn ¶
func (c BaseConfig) ValidateWriteOptIn(prefix string) error
func (BaseConfig) WriteEnabled ¶
func (c BaseConfig) WriteEnabled() bool
type CatalogService ¶
type CatalogService interface {
Query(ctx context.Context, sql string, maxRows int) (QueryResult, error)
Execute(ctx context.Context, sql string) (int64, error)
ListDatabases(ctx context.Context, limit int) ([]map[string]any, error)
ListSchemas(ctx context.Context, limit int) ([]map[string]any, error)
ListTables(ctx context.Context, schema string, limit int) ([]map[string]any, error)
DescribeTable(ctx context.Context, schema, table string) ([]map[string]any, error)
DefaultSchema() string
}
type PoolConfig ¶
type QueryLimits ¶
type QueryResult ¶
func RowsToJSON ¶
func RowsToJSON(rows *sql.Rows, cfg QueryLimits) (QueryResult, error)
type ToolsetOptions ¶
Click to show internal directories.
Click to hide internal directories.