Documentation
¶
Index ¶
- func ContentHash(tables []DuckLakeTable) string
- func ContentHashFull(tables []DuckLakeTable, views []DuckLakeView) string
- func GenerateSchemaDocument(tables []DuckLakeTable) *ast.SchemaDocument
- func GenerateSchemaDocumentFull(tables []DuckLakeTable, views []DuckLakeView) *ast.SchemaDocument
- func SchemaVersion(ctx context.Context, pool *db.Pool, prefix string) (int, error)
- type DuckLakeColumn
- type DuckLakeTable
- type DuckLakeView
- type IntrospectFilter
- type IntrospectResult
- type SchemaChanges
- type Source
- func (s *Source) Attach(ctx context.Context, pool *db.Pool) error
- func (s *Source) CatalogSource(ctx context.Context, pool *db.Pool) (cs.Catalog, error)
- func (s *Source) Definition() types.DataSource
- func (s *Source) Detach(ctx context.Context, pool *db.Pool) error
- func (s *Source) Engine() engines.Engine
- func (s *Source) IsAttached() bool
- func (s *Source) Name() string
- func (s *Source) ReadOnly() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentHash ¶
func ContentHash(tables []DuckLakeTable) string
ContentHash computes a stable hash of the introspected schema for version tracking.
func ContentHashFull ¶
func ContentHashFull(tables []DuckLakeTable, views []DuckLakeView) string
ContentHashFull computes a stable hash including both tables and views.
func GenerateSchemaDocument ¶
func GenerateSchemaDocument(tables []DuckLakeTable) *ast.SchemaDocument
GenerateSchemaDocument generates a GraphQL AST schema document from introspected tables.
func GenerateSchemaDocumentFull ¶
func GenerateSchemaDocumentFull(tables []DuckLakeTable, views []DuckLakeView) *ast.SchemaDocument
GenerateSchemaDocumentFull generates a GraphQL AST schema document from tables and views.
Types ¶
type DuckLakeColumn ¶
DuckLakeColumn represents a column discovered from DuckLake metadata.
type DuckLakeTable ¶
type DuckLakeTable struct {
SchemaName string
TableName string
Columns []DuckLakeColumn
}
DuckLakeTable represents a table discovered from DuckLake metadata.
func IntrospectSchema ¶
IntrospectSchema queries DuckLake metadata tables and returns table/column definitions. The prefix is the DuckDB catalog name (from ATTACH AS prefix).
func IntrospectSchemaFiltered ¶
func IntrospectSchemaFiltered(ctx context.Context, pool *db.Pool, prefix string, filter *IntrospectFilter) ([]DuckLakeTable, error)
IntrospectSchemaFiltered queries DuckLake metadata tables and returns table/column definitions, optionally filtering by schema/table name regexps.
type DuckLakeView ¶
type DuckLakeView struct {
SchemaName string
ViewName string
Columns []DuckLakeColumn
}
DuckLakeView represents a view discovered from DuckLake metadata.
type IntrospectFilter ¶
type IntrospectFilter struct {
SchemaFilter *regexp.Regexp // If set, only schemas matching this regexp are included
TableFilter *regexp.Regexp // If set, only tables matching this regexp are included
}
IntrospectFilter holds optional regexp filters for schema/table names.
func NewIntrospectFilter ¶
func NewIntrospectFilter(schemaFilter, tableFilter string) (*IntrospectFilter, error)
NewIntrospectFilter compiles schema/table filter regexps. Empty strings mean no filter.
func (*IntrospectFilter) Match ¶
func (f *IntrospectFilter) Match(schemaName, tableName string) bool
Match returns true if the schema/table name passes the filters.
type IntrospectResult ¶
type IntrospectResult struct {
Tables []DuckLakeTable
Views []DuckLakeView
}
IntrospectResult holds the results of schema introspection.
func IntrospectAll ¶
func IntrospectAll(ctx context.Context, pool *db.Pool, prefix string, filter *IntrospectFilter) (*IntrospectResult, error)
IntrospectAll queries DuckLake metadata tables and returns both tables and views.
type SchemaChanges ¶
type SchemaChanges struct {
// Added contains tables that were created after fromSnapshot.
Added []DuckLakeTable
// Dropped contains tables (name only) that were dropped after fromSnapshot.
Dropped []DuckLakeTable
// Modified contains tables whose columns changed after fromSnapshot.
// Each entry has the full current column set for the table.
Modified []DuckLakeTable
}
SchemaChanges describes tables that changed between two schema versions.
func IntrospectChanges ¶
func IntrospectChanges(ctx context.Context, pool *db.Pool, prefix string, fromSnapshot int) (*SchemaChanges, error)
IntrospectChanges queries DuckLake metadata for schema changes between fromSnapshot and the current state. Only touches tables/columns with begin_snapshot > fromSnapshot or end_snapshot > fromSnapshot. This is O(changed) instead of O(all) compared to full IntrospectSchema + DiffSchemas.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) CatalogSource ¶
CatalogSource implements the SelfDescriber interface. It introspects DuckLake metadata tables and generates a GraphQL catalog.
func (*Source) Definition ¶
func (s *Source) Definition() types.DataSource