Documentation
¶
Index ¶
- func GetDefaultCachePath(baseDir string) string
- type ColumnInfo
- type Discoverer
- type NoOpDiscoverer
- type SchemaCache
- type StaticDiscoverer
- func (s *StaticDiscoverer) DiscoverTables() ([]string, error)
- func (s *StaticDiscoverer) GetTableColumns(table string) ([]ColumnInfo, error)
- func (s *StaticDiscoverer) LoadCache(cacheFile string) error
- func (s *StaticDiscoverer) SaveCache(cacheFile string) error
- func (s *StaticDiscoverer) SetTableColumns(table string, columns []ColumnInfo)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultCachePath ¶
GetDefaultCachePath returns the default path for schema cache
Types ¶
type ColumnInfo ¶
type ColumnInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Nullable bool `json:"nullable"`
IsPrimary bool `json:"is_primary"`
Default string `json:"default,omitempty"`
}
ColumnInfo represents column metadata
type Discoverer ¶
type Discoverer interface {
DiscoverTables() ([]string, error)
GetTableColumns(table string) ([]ColumnInfo, error)
SaveCache(cacheFile string) error
LoadCache(cacheFile string) error
}
Discoverer defines the interface for schema discovery
func CreateDiscoverer ¶
func CreateDiscoverer(mode string, staticTables []string, dbType string, dbConfig map[string]string) (Discoverer, error)
CreateDiscoverer creates a discoverer based on mode and configuration
type NoOpDiscoverer ¶
type NoOpDiscoverer struct{}
NoOpDiscoverer implements Discoverer for when discovery is disabled
func NewNoOpDiscoverer ¶
func NewNoOpDiscoverer() *NoOpDiscoverer
func (*NoOpDiscoverer) DiscoverTables ¶
func (n *NoOpDiscoverer) DiscoverTables() ([]string, error)
func (*NoOpDiscoverer) GetTableColumns ¶
func (n *NoOpDiscoverer) GetTableColumns(table string) ([]ColumnInfo, error)
func (*NoOpDiscoverer) LoadCache ¶
func (n *NoOpDiscoverer) LoadCache(cacheFile string) error
func (*NoOpDiscoverer) SaveCache ¶
func (n *NoOpDiscoverer) SaveCache(cacheFile string) error
type SchemaCache ¶
type SchemaCache struct {
Tables map[string][]ColumnInfo `json:"tables"`
Version string `json:"version"`
}
SchemaCache represents cached schema information
type StaticDiscoverer ¶
type StaticDiscoverer struct {
Tables []string
ColumnInfo map[string][]ColumnInfo
}
StaticDiscoverer implements Discoverer for static table lists
func NewStaticDiscoverer ¶
func NewStaticDiscoverer(tables []string) *StaticDiscoverer
func (*StaticDiscoverer) DiscoverTables ¶
func (s *StaticDiscoverer) DiscoverTables() ([]string, error)
func (*StaticDiscoverer) GetTableColumns ¶
func (s *StaticDiscoverer) GetTableColumns(table string) ([]ColumnInfo, error)
func (*StaticDiscoverer) LoadCache ¶
func (s *StaticDiscoverer) LoadCache(cacheFile string) error
func (*StaticDiscoverer) SaveCache ¶
func (s *StaticDiscoverer) SaveCache(cacheFile string) error
func (*StaticDiscoverer) SetTableColumns ¶
func (s *StaticDiscoverer) SetTableColumns(table string, columns []ColumnInfo)
Click to show internal directories.
Click to hide internal directories.