mirror of
https://github.com/turbot/steampipe.git
synced 2026-03-22 01:00:20 -04:00
- Execute RefreshConnections asyncronously - Add connection_state table to indicate the loading state of connections - Optimise RefreshConnections by cloning connection schemas - Add locking to ensure only a single instance of RefreshConnections runs - Start executing queries without waiting for connections to load, add smart error handling to wait for required connection - Optimise autocomplete for high connection count - Autocomplete and inspect data available before all conections are refreshed - Update file watcher to respond to CHMOD, so thaat it pickes up deletion of file contents Closes #3394 Closes #3267
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package steampipeconfig
|
|
|
|
type WaitModeValue int
|
|
|
|
const (
|
|
NoWait WaitModeValue = iota
|
|
WaitForLoading
|
|
WaitForReady
|
|
WaitForSearchPath
|
|
)
|
|
|
|
type LoadConnectionStateConfiguration struct {
|
|
WaitMode WaitModeValue
|
|
Connections []string
|
|
SearchPath []string
|
|
}
|
|
|
|
type LoadConnectionStateOption = func(config *LoadConnectionStateConfiguration)
|
|
|
|
// WithWaitUntilLoading waits until no connections are in pending state
|
|
var WithWaitUntilLoading = func() func(config *LoadConnectionStateConfiguration) {
|
|
return func(config *LoadConnectionStateConfiguration) {
|
|
config.WaitMode = WaitForLoading
|
|
}
|
|
}
|
|
|
|
var WithWaitForSearchPath = func(searchPath []string) func(config *LoadConnectionStateConfiguration) {
|
|
return func(config *LoadConnectionStateConfiguration) {
|
|
config.WaitMode = WaitForSearchPath
|
|
config.SearchPath = searchPath
|
|
}
|
|
}
|
|
|
|
// WithWaitUntilReady waits until all are in ready state
|
|
var WithWaitUntilReady = func(connections ...string) func(config *LoadConnectionStateConfiguration) {
|
|
return func(config *LoadConnectionStateConfiguration) {
|
|
config.Connections = connections
|
|
config.WaitMode = WaitForReady
|
|
}
|
|
}
|