catalog

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package catalog exposes stable schema and agent-context helpers for tinySQL databases without requiring callers to query internal sys.* tables directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAgentContext

func BuildAgentContext(ctx context.Context, db *tinysql.DB, tenant string, cfg AgentContextConfig) (string, error)

BuildAgentContext returns a compact prompt-ready database profile.

Types

type AgentContextConfig

type AgentContextConfig = tinysql.AgentContextConfig

AgentContextConfig controls the prompt-sized database profile.

func DefaultAgentContextConfig

func DefaultAgentContextConfig() AgentContextConfig

DefaultAgentContextConfig returns a bounded agent-context configuration.

type Column

type Column struct {
	Tenant     string
	TableName  string
	Name       string
	Position   string
	DataType   string
	Constraint string
	FKTable    string
	FKColumn   string
}

Column describes a catalog column.

func ListColumns

func ListColumns(ctx context.Context, db *tinysql.DB, tenant string) ([]Column, error)

ListColumns returns table/view column metadata from sys.columns.

type Object

type Object struct {
	Schema string
	Name   string
	Type   string
	Status string
}

Object describes a table, view, job, trigger, or other catalog object.

func ListObjects

func ListObjects(ctx context.Context, db *tinysql.DB, tenant string) ([]Object, error)

ListObjects returns unified object metadata from sys.objects.

Jump to

Keyboard shortcuts

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