Documentation
¶
Index ¶
Constants ¶
View Source
const ( FileSourceType types.CatalogSourceType = "localFS" URISourceType types.CatalogSourceType = "uri" URIFileSourceType types.CatalogSourceType = "uriFile" )
Variables ¶
View Source
var ErrNoSourcesByURI = errors.New("no sources found by URI")
Functions ¶
This section is empty.
Types ¶
type CatalogSourceLoader ¶
type DBColumnInfo ¶ added in v0.1.14
type DBColumnInfo struct {
Name string `json:"name"`
Description string `json:"description"`
DataType string `json:"data_type"`
IsNullable bool `json:"is_nullable"`
Default string `json:"default,omitempty"`
}
func (*DBColumnInfo) Definition ¶ added in v0.1.14
func (c *DBColumnInfo) Definition() (*ast.FieldDefinition, error)
type DBConstraintInfo ¶ added in v0.1.14
type DBConstraintInfo struct {
Name string `json:"name"`
Type string `json:"type"` // e.g., PRIMARY KEY, FOREIGN KEY, UNIQUE
Columns []string `json:"columns"` // list of column names involved in the constraint
ReferencesSchema string `json:"references_schema_name,omitempty"` // for foreign keys, the schema of the referenced table
ReferencesTable string `json:"references_table_name,omitempty"` // for foreign keys
ReferencesColumns []string `json:"references_columns,omitempty"` // columns in the referenced table
}
type DBInfo ¶ added in v0.1.14
type DBInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"` // e.g., "mysql", "postgres", "duckdb", "memory", etc.
SchemaInfo []DBSchemaInfo `json:"schemas"`
}
create catalog source by provided database definition
func DescribeDataSource ¶ added in v0.1.14
func (*DBInfo) SchemaDocument ¶ added in v0.1.14
type DBSchemaInfo ¶ added in v0.1.14
type DBSchemaInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Tables []DBTableInfo `json:"tables"`
Views []DBViewInfo `json:"views"`
}
func (*DBSchemaInfo) Definitions ¶ added in v0.1.14
func (s *DBSchemaInfo) Definitions() (ast.DefinitionList, error)
type DBTableInfo ¶ added in v0.1.14
type DBTableInfo struct {
Name string `json:"name"`
Description string `json:"description"`
SchemaName string `json:"schema_name"`
Columns []DBColumnInfo `json:"columns"`
Constraints []DBConstraintInfo `json:"constraints"`
}
func (*DBTableInfo) Definition ¶ added in v0.1.14
func (t *DBTableInfo) Definition() (*ast.Definition, error)
type DBViewInfo ¶ added in v0.1.14
type DBViewInfo struct {
Name string `json:"name"`
SchemaName string `json:"schema_name"`
Description string `json:"description"`
Columns []DBColumnInfo `json:"columns"`
}
func (*DBViewInfo) Definition ¶ added in v0.1.14
func (v *DBViewInfo) Definition() (*ast.Definition, error)
type FileSource ¶
type FileSource struct {
// contains filtered or unexported fields
}
func NewFileSource ¶
func NewFileSource(path string) *FileSource
func (*FileSource) SchemaDocument ¶
func (s *FileSource) SchemaDocument(ctx context.Context) (*ast.SchemaDocument, error)
type MergedSource ¶
type MergedSource struct {
// contains filtered or unexported fields
}
func MergeSource ¶
func MergeSource(sources ...Source) *MergedSource
func (*MergedSource) SchemaDocument ¶
func (s *MergedSource) SchemaDocument(ctx context.Context) (*ast.SchemaDocument, error)
type Source ¶
type Source interface {
SchemaDocument(ctx context.Context) (*ast.SchemaDocument, error)
}
type StringSource ¶
type StringSource struct {
// contains filtered or unexported fields
}
func NewStringSource ¶
func NewStringSource(name string, sources ...string) StringSource
func (StringSource) SchemaDocument ¶
func (s StringSource) SchemaDocument(_ context.Context) (*ast.SchemaDocument, error)
type URISource ¶
type URISource struct {
// contains filtered or unexported fields
}
func (URISource) SchemaDocument ¶
Click to show internal directories.
Click to hide internal directories.