Documentation
¶
Index ¶
- Variables
- type DaemonProvider
- type ExecArgs
- func (m *ExecArgs) DecodeFields(r model.FieldReader)
- func (m *ExecArgs) EncodeFields(w model.FieldWriter)
- func (m *ExecArgs) IsNil() bool
- func (m *ExecArgs) ModelName() string
- func (m *ExecArgs) Pointers() []any
- func (m *ExecArgs) Schema() []model.Field
- func (m *ExecArgs) Validate(action byte) error
- type ExecArgsList
- func (s *ExecArgsList) Append() model.Fielder
- func (s *ExecArgsList) At(i int) model.Fielder
- func (s *ExecArgsList) DecodeFields(_ model.FieldReader)
- func (s *ExecArgsList) EncodeFields(_ model.FieldWriter)
- func (s *ExecArgsList) IsNil() bool
- func (s *ExecArgsList) Len() int
- func (s *ExecArgsList) Pointers() []any
- func (s *ExecArgsList) Schema() []model.Field
- type ExportFunc
- type Provider
- type QueryArgs
- func (m *QueryArgs) DecodeFields(r model.FieldReader)
- func (m *QueryArgs) EncodeFields(w model.FieldWriter)
- func (m *QueryArgs) IsNil() bool
- func (m *QueryArgs) ModelName() string
- func (m *QueryArgs) Pointers() []any
- func (m *QueryArgs) Schema() []model.Field
- func (m *QueryArgs) Validate(action byte) error
- type QueryArgsList
- func (s *QueryArgsList) Append() model.Fielder
- func (s *QueryArgsList) At(i int) model.Fielder
- func (s *QueryArgsList) DecodeFields(_ model.FieldReader)
- func (s *QueryArgsList) EncodeFields(_ model.FieldWriter)
- func (s *QueryArgsList) IsNil() bool
- func (s *QueryArgsList) Len() int
- func (s *QueryArgsList) Pointers() []any
- func (s *QueryArgsList) Schema() []model.Field
Constants ¶
This section is empty.
Variables ¶
var ExecArgsModel = model.Definition{ Name: "exec_args", Fields: model.Fields{ { Name: "SQL", Type: model.Text(), NotNull: true, Permitted: sqlPermitted, }, }, }
var QueryArgsModel = model.Definition{ Name: "query_args", Fields: model.Fields{ { Name: "SQL", Type: model.Text(), NotNull: true, Permitted: sqlPermitted, }, }, }
Functions ¶
This section is empty.
Types ¶
type DaemonProvider ¶
type DaemonProvider struct {
// contains filtered or unexported fields
}
DaemonProvider implements mcp.ToolProvider for the MCP daemon. Tools are registered at startup; SetDB wires the live connection at runtime.
func NewDaemonProvider ¶
func NewDaemonProvider() *DaemonProvider
NewDaemonProvider creates a new DaemonProvider.
func (*DaemonProvider) SetDB ¶
func (p *DaemonProvider) SetDB(db *orm.DB)
SetDB swaps the active DB. Call with nil when the project stops.
func (*DaemonProvider) SetExportFunc ¶ added in v0.0.11
func (p *DaemonProvider) SetExportFunc(fn ExportFunc)
SetExportFunc swaps the active DDL export function. Call with nil when the project stops.
func (*DaemonProvider) Tools ¶
func (p *DaemonProvider) Tools() []mcp.Tool
Tools returns db_schema (always), db_query, db_exec — fixed schemas, no DB required.
type ExecArgs ¶
type ExecArgs struct {
Sql string
}
func (*ExecArgs) DecodeFields ¶
func (m *ExecArgs) DecodeFields(r model.FieldReader)
func (*ExecArgs) EncodeFields ¶
func (m *ExecArgs) EncodeFields(w model.FieldWriter)
type ExecArgsList ¶
type ExecArgsList []*ExecArgs
func (*ExecArgsList) Append ¶
func (s *ExecArgsList) Append() model.Fielder
func (*ExecArgsList) DecodeFields ¶
func (s *ExecArgsList) DecodeFields(_ model.FieldReader)
func (*ExecArgsList) EncodeFields ¶
func (s *ExecArgsList) EncodeFields(_ model.FieldWriter)
func (*ExecArgsList) IsNil ¶
func (s *ExecArgsList) IsNil() bool
func (*ExecArgsList) Len ¶
func (s *ExecArgsList) Len() int
func (*ExecArgsList) Pointers ¶
func (s *ExecArgsList) Pointers() []any
func (*ExecArgsList) Schema ¶
func (s *ExecArgsList) Schema() []model.Field
type ExportFunc ¶ added in v0.0.11
ExportFunc produces the DDL SQL for the currently synced schema. Supplied by the caller (e.g. ormc.Generator.ExportSQL bound to a dialect compiler) — sqlmcp has no model registry of its own to derive this from since orm dropped Open/Register (see orm docs/PLAN.md §2).
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements mcp.ToolProvider for a live *orm.DB connection.
func NewProvider ¶
func NewProvider(db *orm.DB, exportFn ExportFunc) *Provider
NewProvider creates a new MCP tool provider wrapping the given DB and DDL export function. exportFn may be nil — db_export_schema then reports it isn't configured.
type QueryArgs ¶
type QueryArgs struct {
Sql string
}
func (*QueryArgs) DecodeFields ¶
func (m *QueryArgs) DecodeFields(r model.FieldReader)
func (*QueryArgs) EncodeFields ¶
func (m *QueryArgs) EncodeFields(w model.FieldWriter)
type QueryArgsList ¶
type QueryArgsList []*QueryArgs
func (*QueryArgsList) Append ¶
func (s *QueryArgsList) Append() model.Fielder
func (*QueryArgsList) DecodeFields ¶
func (s *QueryArgsList) DecodeFields(_ model.FieldReader)
func (*QueryArgsList) EncodeFields ¶
func (s *QueryArgsList) EncodeFields(_ model.FieldWriter)
func (*QueryArgsList) IsNil ¶
func (s *QueryArgsList) IsNil() bool
func (*QueryArgsList) Len ¶
func (s *QueryArgsList) Len() int
func (*QueryArgsList) Pointers ¶
func (s *QueryArgsList) Pointers() []any
func (*QueryArgsList) Schema ¶
func (s *QueryArgsList) Schema() []model.Field