core

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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 QueryResult

type QueryResult struct {
	Columns []string
	Rows    []map[string]any // (column_name: value)
}

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 []string
}

TableSchema represents the structure of a database table.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL