Documentation
¶
Overview ¶
Package core defines the core interfaces and types for CoreMCP database adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶ added in v0.2.0
type ColumnInfo struct {
Name string
DataType string
IsNullable bool
Description string // Comment/Description from database
}
ColumnInfo represents detailed information about a table column.
type ForeignKey ¶ added in v0.2.0
type ForeignKey struct {
ColumnName string
ReferencedTable string
ReferencedColumn string
ConstraintName string
}
ForeignKey represents a foreign key relationship.
type QueryResult ¶
QueryResult contains the results of a database query execution.
type Source ¶
type Source interface {
// Name returns the human-readable name of the database adapter.
Name() string
// Connect establishes a connection to the database.
Connect(ctx context.Context) error
// Close closes the database connection.
Close(ctx context.Context) error
// GetSchema retrieves the database schema information.
GetSchema(ctx context.Context) ([]TableSchema, error)
// ExecuteQuery runs a SQL query and returns the results.
ExecuteQuery(ctx context.Context, query string, args ...any) (*QueryResult, error)
}
Source represents a database connection and query interface. All database adapters must implement this interface.
type TableSchema ¶
type TableSchema struct {
Name string
Columns []ColumnInfo
ForeignKeys []ForeignKey
PrimaryKeys []string
}
TableSchema represents the structure of a database table.
Click to show internal directories.
Click to hide internal directories.