postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name    = "postgres-mcp"
	Version = buildinfo.Version
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB       shareddb.BaseConfig
	DSN      string
	Host     string
	Port     int
	User     string
	Password string
	Database string
	SSLMode  string
}

func LoadConfig

func LoadConfig() (Config, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, logger *logging.Logger) (*server.MCPServer, *Service, error)

func Open

func Open(ctx context.Context, cfg Config) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) DefaultSchema

func (s *Service) DefaultSchema() string

func (*Service) DescribeTable

func (s *Service) DescribeTable(ctx context.Context, schema, table string) ([]map[string]any, error)

func (*Service) Execute

func (s *Service) Execute(ctx context.Context, statement string) (int64, error)

func (*Service) ListDatabases

func (s *Service) ListDatabases(ctx context.Context, limit int) ([]map[string]any, error)

func (*Service) ListSchemas

func (s *Service) ListSchemas(ctx context.Context, limit int) ([]map[string]any, error)

func (*Service) ListTables

func (s *Service) ListTables(ctx context.Context, schema string, limit int) ([]map[string]any, error)

func (*Service) Query

func (s *Service) Query(ctx context.Context, statement string, maxRows int) (shareddb.QueryResult, error)

Jump to

Keyboard shortcuts

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