yvbolt/loadedDatabase.go

31 lines
724 B
Go
Raw Normal View History

package main
import (
"github.com/ying32/govcl/vcl"
)
2024-06-27 23:34:00 +00:00
type contextAction struct {
Name string
Callback func(ndata *navData)
}
// loadedDatabase is a DB-agnostic interface for each loaded database.
type loadedDatabase interface {
DisplayName() string
DriverName() string
RootElement() *vcl.TTreeNode
RenderForNav(f *TMainForm, ndata *navData)
2024-06-15 00:14:11 +00:00
ExecQuery(query string, resultArea *vcl.TListView)
NavChildren(ndata *navData) ([]string, error)
2024-06-27 23:34:00 +00:00
NavContext(ndata *navData) ([]contextAction, error)
Keepalive(ndata *navData)
Close()
}
// navData is the .Data() pointer for each TTreeNode in the left-hand tree.
type navData struct {
ld loadedDatabase
childrenLoaded bool
bucketPath []string
}