schema

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package schema implements the read-only exploration commands that mirror the original MCP's get_schema_info, get_table_sample, list_resources and read_resource. All identifiers are validated before interpolation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(ctx context.Context, pool *conn.Pool, table string) (result.Result, error)

Analyze returns a combined view: schema columns followed by a 5-row sample. Rows are tagged by section in the first column so an agent can distinguish.

func Databases

func Databases(ctx context.Context, pool *conn.Pool) (result.Result, error)

Databases lists non-system databases.

func Explore

func Explore(ctx context.Context, pool *conn.Pool) (result.Result, error)

Explore returns one row per (database, table) across non-system databases.

func Read

func Read(ctx context.Context, pool *conn.Pool, table string) (result.Result, error)

Read returns up to 100 rows from a table (mirrors read_resource).

func Sample

func Sample(ctx context.Context, pool *conn.Pool, table string, limit int) (result.Result, error)

Sample returns up to limit rows from table; limit is clamped to [1,20].

func Schema

func Schema(ctx context.Context, pool *conn.Pool, table string) (result.Result, error)

Schema returns column metadata for one table, or all tables when table is empty.

func Tables

func Tables(ctx context.Context, pool *conn.Pool, db string) (result.Result, error)

Tables lists tables in db (or the current database if db is empty).

Types

This section is empty.

Jump to

Keyboard shortcuts

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