metainfo

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentInfo added in v0.1.28

type ArgumentInfo struct {
	Name         string      `json:"name"`
	Type         string      `json:"type"`
	Description  string      `json:"description"`
	IsScalarType bool        `json:"is_scalar_type"`
	IsRequired   bool        `json:"is_required"`
	IsArray      bool        `json:"is_array"`
	NestedFields []FieldInfo `json:"nested_fields,omitempty"`
}

type DataObjectInfo added in v0.1.28

type DataObjectInfo struct {
	Name          string             `json:"name"`
	Module        string             `json:"module"`
	DataSource    string             `json:"data_source"`
	Type          DataObjectType     `json:"type"`
	Description   string             `json:"description"`
	HasPrimaryKey bool               `json:"has_primary_key"`
	HasGeometry   bool               `json:"has_geometry"`
	IsM2M         bool               `json:"is_m2m"`
	IsCube        bool               `json:"is_cube"`
	IsHypertable  bool               `json:"is_hypertable"`
	Columns       []FieldInfo        `json:"columns"`
	References    []SubqueryInfo     `json:"relations,omitempty"`
	Subqueries    []SubqueryInfo     `json:"subqueries,omitempty"`
	FunctionCalls []FunctionCallInfo `json:"function_calls,omitempty"`

	AggregationType       string        `json:"aggregation_type,omitempty"`
	SubAggregationType    string        `json:"sub_aggregation_type,omitempty"`
	BucketAggregationType string        `json:"bucket_aggregation_type,omitempty"`
	FilterType            string        `json:"filter_type"`
	Arguments             *ArgumentInfo `json:"arguments,omitempty"`

	Queries   []QueryInfo   `json:"queries"`
	Mutations *MutationInfo `json:"mutations,omitempty"`
}

type DataObjectType added in v0.1.28

type DataObjectType string
const (
	DataObjectTypeTable DataObjectType = compiler.Table
	DataObjectTypeView  DataObjectType = compiler.View
)

type DataSourceInfo added in v0.1.28

type DataSourceInfo struct {
	Name        string `json:"name"`
	Prefix      string `json:"prefix"`
	Type        string `json:"type"`
	Description string `json:"description"`
	ReadOnly    bool   `json:"read_only"`
	AsModule    bool   `json:"as_module"`
}

type Engine added in v0.1.28

type Engine interface {
	types.Querier
	Schema() *ast.Schema
}

The runtime meta-info source provides access to the metadata of DuckDB attached databases, their schemas, relations, and columns.

type FieldInfo added in v0.1.28

type FieldInfo struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`

	ReturnsArray bool `json:"returns_array"`
	IsPrimaryKey bool `json:"is_primary_key"`
	Nullable     bool `json:"nullable"`
	IsCalculated bool `json:"is_calculated"`

	Arguments []ArgumentInfo `json:"arguments,omitempty"`

	NestedFields []FieldInfo `json:"nested_fields,omitempty"`
	ExtraFields  []FieldInfo `json:"extra_fields,omitempty"`
}

type FunctionCallInfo added in v0.1.28

type FunctionCallInfo struct {
	Name            string         `json:"name"`
	Module          string         `json:"module"`
	DataSource      string         `json:"data_source"`
	FieldName       string         `json:"field_name"`
	ReturnType      string         `json:"result_type"`
	IsScalarFunc    bool           `json:"is_scalar"`
	ReturnsArray    bool           `json:"returns_array"`
	IsTableFuncJoin bool           `json:"is_table_func_join"`
	Description     string         `json:"description"`
	Arguments       []ArgumentInfo `json:"arguments,omitempty"`
}

type FunctionInfo added in v0.1.28

type FunctionInfo struct {
	Name                  string         `json:"name"`
	Description           string         `json:"description"`
	Module                string         `json:"module"`
	DataSource            string         `json:"data_source"`
	Arguments             []ArgumentInfo `json:"arguments,omitempty"`
	ReturnType            string         `json:"return_type"`
	ReturnsArray          bool           `json:"returns_array"`
	ReturnTypeFields      []FieldInfo    `json:"return_type_fields,omitempty"`
	AggregationType       string         `json:"aggregation_type,omitempty"`
	SubAggregationType    string         `json:"sub_aggregation_type,omitempty"`
	BucketAggregationType string         `json:"bucket_aggregation_type,omitempty"`
}

type ModuleInfo added in v0.1.28

type ModuleInfo struct {
	Name                 string           `json:"name"`
	Description          string           `json:"description"`
	QueryType            string           `json:"query_type,omitempty"`
	FunctionType         string           `json:"function_type,omitempty"`
	MutationType         string           `json:"mutation_type,omitempty"`
	MutationFunctionType string           `json:"mutation_function_type,omitempty"`
	SubModules           []ModuleInfo     `json:"sub_modules,omitempty"`
	Tables               []DataObjectInfo `json:"tables,omitempty"`
	Views                []DataObjectInfo `json:"views,omitempty"`
	Functions            []FunctionInfo   `json:"functions,omitempty"`
	MutateFunctions      []FunctionInfo   `json:"mutate_functions,omitempty"`
	SpecialQueries       []QueryInfo      `json:"special_queries,omitempty"`
}

func (*ModuleInfo) AllFunctions added in v0.1.28

func (m *ModuleInfo) AllFunctions() []*FunctionInfo

func (*ModuleInfo) AllMutationFunctions added in v0.1.28

func (m *ModuleInfo) AllMutationFunctions() []*FunctionInfo

func (*ModuleInfo) DataObject added in v0.1.28

func (m *ModuleInfo) DataObject(name string) *DataObjectInfo

func (*ModuleInfo) DataObjects added in v0.1.28

func (m *ModuleInfo) DataObjects() []*DataObjectInfo

func (*ModuleInfo) Function added in v0.1.28

func (m *ModuleInfo) Function(name string) *FunctionInfo

func (*ModuleInfo) Modules added in v0.1.28

func (m *ModuleInfo) Modules() []*ModuleInfo

func (*ModuleInfo) MutationFunction added in v0.1.28

func (m *ModuleInfo) MutationFunction(name string) *FunctionInfo

func (*ModuleInfo) SubModule added in v0.1.28

func (m *ModuleInfo) SubModule(path string) *ModuleInfo

type MutationInfo added in v0.1.28

type MutationInfo struct {
	InsertMutation string `json:"insert_mutation"`
	InsertDataType string `json:"insert_data_type"`
	UpdateMutation string `json:"update_mutation"`
	UpdateDataType string `json:"update_data_type"`
	DeleteMutation string `json:"delete_mutation"`
}

type QueryInfo added in v0.1.28

type QueryInfo struct {
	Name             string         `json:"name"`
	Path             string         `json:"path"`
	Type             QueryType      `json:"type"`
	Description      string         `json:"description"`
	Arguments        []ArgumentInfo `json:"arguments,omitempty"`
	ReturnedTypeName string         `json:"returned_type"`
	IsSingleRow      bool           `json:"is_single_row"`
	ReturnTypeFields []FieldInfo    `json:"return_type_fields,omitempty"`
}

type QueryType added in v0.1.28

type QueryType string
const (
	QueryTypeJQ              QueryType = "jq"
	QueryTypeH3              QueryType = "h3"
	QueryTypeSelect          QueryType = "select"
	QueryTypeSelectOne       QueryType = "select_one"
	QueryTypeAggregate       QueryType = "aggregate"
	QueryTypeAggregateBucket QueryType = "bucket_aggregate"
)

type ReferenceType added in v0.1.28

type ReferenceType string
const (
	ReferenceTypeOneToMany  ReferenceType = "one_to_many"
	ReferenceTypeManyToOne  ReferenceType = "many_to_one"
	ReferenceTypeManyToMany ReferenceType = "many_to_many"
)

type SchemaInfo added in v0.1.28

type SchemaInfo struct {
	QueryRoot    string           `json:"query_root"`
	MutationRoot string           `json:"mutation_root"`
	DataSources  []DataSourceInfo `json:"data_sources"`
	RootModule   ModuleInfo       `json:"modules"`
}

func (*SchemaInfo) DataObjects added in v0.1.28

func (s *SchemaInfo) DataObjects() []*DataObjectInfo

func (*SchemaInfo) DataSource added in v0.1.28

func (s *SchemaInfo) DataSource(name string) *DataSourceInfo

func (*SchemaInfo) Function added in v0.1.28

func (s *SchemaInfo) Function(path string) *FunctionInfo

func (*SchemaInfo) Functions added in v0.1.28

func (s *SchemaInfo) Functions() []*FunctionInfo

func (*SchemaInfo) Module added in v0.1.28

func (s *SchemaInfo) Module(path string) *ModuleInfo

func (*SchemaInfo) Modules added in v0.1.28

func (s *SchemaInfo) Modules() []*ModuleInfo

func (*SchemaInfo) MutateFunction added in v0.1.28

func (s *SchemaInfo) MutateFunction(path string) *FunctionInfo

func (*SchemaInfo) MutationFunctions added in v0.1.28

func (s *SchemaInfo) MutationFunctions() []*FunctionInfo

func (*SchemaInfo) SpecialQuery added in v0.1.28

func (s *SchemaInfo) SpecialQuery(path string) *QueryInfo

func (*SchemaInfo) Table added in v0.1.28

func (s *SchemaInfo) Table(path string) *DataObjectInfo

func (*SchemaInfo) View added in v0.1.28

func (s *SchemaInfo) View(path string) *DataObjectInfo

type Source

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

func New

func New(qe Engine) *Source

func (*Source) AsModule

func (s *Source) AsModule() bool

func (*Source) Attach

func (s *Source) Attach(ctx context.Context, pool *db.Pool) error

func (*Source) Catalog

func (s *Source) Catalog(ctx context.Context) sources.Source

func (*Source) Engine

func (s *Source) Engine() engines.Engine

func (*Source) IsReadonly

func (s *Source) IsReadonly() bool

func (*Source) Name

func (s *Source) Name() string

func (*Source) Summary added in v0.1.28

func (s *Source) Summary(ctx context.Context) (*SchemaInfo, error)

Function to get summary structured information about schema.

type SubqueryInfo added in v0.1.28

type SubqueryInfo struct {
	Name                string        `json:"name"`
	Type                ReferenceType `json:"type"`
	M2MTable            string        `json:"m2m_table,omitempty"`
	DataSource          string        `json:"data_source"`
	DataObject          string        `json:"data_object"`
	Module              string        `json:"module"`
	FieldDataQuery      string        `json:"field_data_query,omitempty"`
	FieldDataType       string        `json:"field_data_type,omitempty"`
	FieldAggQuery       string        `json:"field_agg_query,omitempty"`
	FieldAggDataType    string        `json:"field_agg_data_type,omitempty"`
	FieldBucketAggQuery string        `json:"field_bucket_agg_query,omitempty"`
	FieldBucketAggType  string        `json:"field_bucket_agg_type,omitempty"`
	Description         string        `json:"description"`
	DataObjectFields    []FieldInfo   `json:"fields,omitempty"`
}

Jump to

Keyboard shortcuts

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