Files
steampipe/pkg/constants/metaquery_commands.go
Binaek Sarkar 299697ae2f Updates in cache configuration to allow disabling of all caching on server. Closes #3258
STEAMPIPE_CACHE environment variable resolves to service cache enabled as well as client cache enabled

service cache enabled is used by the plugin manager to enable/disable caching on the plugins during startup (runtime toggle is not allowed) - with a max_ttl

client cache enabled is used to enable/disable the cache on the database connection (fdw)
A TTL can also be set on the client side capped to max_ttl on the server
2023-03-31 15:12:25 +01:00

34 lines
1.5 KiB
Go

package constants
import "fmt"
// Metaquery commands
const (
CmdTableList = ".tables" // List all tables
CmdOutput = ".output" // Set output mode
CmdTiming = ".timing" // Toggle query timer
CmdHeaders = ".header" // Toggle headers output
CmdSeparator = ".separator" // Set the column separator
CmdExit = ".exit" // Exit the interactive prompt
CmdQuit = ".quit" // Alias for .exit
CmdInspect = ".inspect" // inspect
CmdConnections = ".connections" // list all connections
CmdMulti = ".multi" // toggle multi line query
CmdClear = ".clear" // clear the console
CmdHelp = ".help" // list all meta commands
CmdSearchPath = ".search_path" // Set or show search-path
CmdSearchPathPrefix = ".search_path_prefix" // set search path prefix
CmdCache = ".cache" // cache control
CmdCacheTtl = ".cache_ttl" // set cache ttl
CmdAutoComplete = ".autocomplete" // enable or disable auto complete
)
// ArgFromMetaquery converts a metaquery of form '.header' into the config argument used to set the mode, i.e. 'header'
func ArgFromMetaquery(cmd string) string {
if cmd[:1] != "." {
panic(fmt.Sprintf("ArgFromMetaquery called for non-metyaquery: %s", cmd))
}
return cmd[1:]
}