Files
steampipe/pkg/interactive/metaquery/suggestions.go
kaidaguerre 40804a3201 Execute RefreshConnections asyncronously and optimise for high connection count. Add connection_state table.
- 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
2023-05-10 09:05:08 +01:00

22 lines
561 B
Go

package metaquery
import (
"sort"
"github.com/c-bata/go-prompt"
)
// PromptSuggestions returns a list of the metaquery suggestions for go-prompt
func PromptSuggestions() []prompt.Suggest {
suggestions := make([]prompt.Suggest, 0, len(metaQueryDefinitions))
for k, definition := range metaQueryDefinitions {
suggestions = append(suggestions, prompt.Suggest{Text: k, Description: definition.description, Output: k})
}
sort.SliceStable(suggestions[:], func(i, j int) bool {
return suggestions[i].Text < suggestions[j].Text
})
return suggestions
}