Documentation ¶
Index ¶
- Constants
- func CreateMetadataTables(ctx context.Context, workspaceResources *modconfig.WorkspaceResourceMaps, ...) error
- func CreatePreparedStatements(ctx context.Context, resourceMaps *modconfig.WorkspaceResourceMaps, ...) error
- func ExecuteQuery(ctx context.Context, queryString string, client Client) (*queryresult.ResultStreamer, error)
- func PgEscapeName(name string) string
- func PgEscapeString(str string) string
- func UpdateMetadataTables(workspaceResources *modconfig.WorkspaceResourceMaps, client Client) error
- func UpdatePreparedStatements(ctx context.Context, resourceMaps *modconfig.WorkspaceResourceMaps, ...) error
- type Client
- type InitResult
- type QueryInitData
- type RefreshConnectionResult
- type WorkspaceResourceProvider
Constants ¶
const TagColumn = "column"
TagColumn :: tag used to specify the column name and type in the reflection tables
Variables ¶
This section is empty.
Functions ¶
func CreateMetadataTables ¶
func ExecuteQuery ¶
func ExecuteQuery(ctx context.Context, queryString string, client Client) (*queryresult.ResultStreamer, error)
ExecuteQuery executes a single query. If shutdownAfterCompletion is true, shutdown the client after completion
func PgEscapeName ¶
func PgEscapeString ¶
PgEscapeString escapes strings which are to be inserted use a custom escape tag to avoid chance of clash with the escaped text https://medium.com/@lnishada/postgres-dollar-quoting-6d23e4f186ec
func UpdateMetadataTables ¶
func UpdateMetadataTables(workspaceResources *modconfig.WorkspaceResourceMaps, client Client) error
func UpdatePreparedStatements ¶
func UpdatePreparedStatements(ctx context.Context, resourceMaps *modconfig.WorkspaceResourceMaps, client Client) error
UpdatePreparedStatements first attempts to deallocate all prepared statements in workspace, then recreates them
Types ¶
type Client ¶
type Client interface { Close() error GetCurrentSearchPath() ([]string, error) SetClientSearchPath() error ExecuteSync(ctx context.Context, query string, disableSpinner bool) (*queryresult.SyncQueryResult, error) Execute(ctx context.Context, query string, disableSpinner bool) (res *queryresult.Result, err error) SchemaMetadata() *schema.Metadata CacheOn() error CacheOff() error CacheClear() error // todo share this between locan and remote client? LoadSchema() ConnectionMap() *steampipeconfig.ConnectionMap RefreshConnectionAndSearchPaths() *RefreshConnectionResult }
type InitResult ¶
func (*InitResult) AddMessage ¶
func (r *InitResult) AddMessage(message string)
func (*InitResult) AddWarnings ¶
func (r *InitResult) AddWarnings(warnings ...string)
func (*InitResult) DisplayMessages ¶
func (r *InitResult) DisplayMessages()
func (*InitResult) HasMessages ¶
func (r *InitResult) HasMessages() bool
type QueryInitData ¶
type QueryInitData struct { Queries []string PreparedStatementProviders *modconfig.WorkspaceResourceMaps Workspace WorkspaceResourceProvider Client Client Result *InitResult }
func NewQueryInitData ¶
func NewQueryInitData() *QueryInitData
type RefreshConnectionResult ¶
RefreshConnectionResult is a structure used to contain the result of either a RefreshConnections or a NewLocalClient operation
func (*RefreshConnectionResult) ShowWarnings ¶
func (r *RefreshConnectionResult) ShowWarnings()
type WorkspaceResourceProvider ¶
type WorkspaceResourceProvider interface { ResolveQueryAndArgs(arg string) (string, modconfig.PreparedStatementProvider, error) GetQueryMap() map[string]*modconfig.Query GetControlMap() map[string]*modconfig.Control GetResourceMaps() *modconfig.WorkspaceResourceMaps GetControl(controlName string) (*modconfig.Control, bool) SetupWatcher(client Client, onError func(err error)) error }
WorkspaceResourceProvider :: interface encapsulating named query searching capability - provided to avoid db needing a reference to workspace