Documentation
¶
Overview ¶
Package metadata caches the server objects that completion needs: databases, tables, columns, functions and friends. The cache is filled from system tables in the background; readers always get an immutable snapshot and never wait for the server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache holds the current snapshot and refreshes it on demand.
func (*Cache) RefreshAsync ¶
func (c *Cache) RefreshAsync()
RefreshAsync starts a background refresh unless one is already running, in which case one more refresh is queued so that the request is not lost.
func (*Cache) RefreshIfOlder ¶
RefreshIfOlder starts a background refresh when the snapshot is older than maxAge.
type Snapshot ¶
type Snapshot struct {
Databases []string
Tables map[string][]Table // by database
Columns map[string][]Column // by TableKey
Functions []Function
TableFunctions []string
DataTypes []string
Engines []string
Formats []string
Settings []string
Keywords []string
// LoadedAt is when the snapshot was fetched; zero for the built-in fallback.
LoadedAt time.Time
}
Snapshot is an immutable view of the cached metadata.
func (*Snapshot) HasDatabase ¶
HasDatabase reports whether a database with this exact name is known.