Documentation ¶
Index ¶
- type DbClient
- func (c *DbClient) CacheClear() error
- func (c *DbClient) CacheOff() error
- func (c *DbClient) CacheOn() error
- func (c *DbClient) Close() error
- func (c *DbClient) ConnectionMap() *steampipeconfig.ConnectionDataMap
- func (c *DbClient) Execute(ctx context.Context, query string, disableSpinner bool) (res *queryresult.Result, err error)
- func (c *DbClient) ExecuteSync(ctx context.Context, query string, disableSpinner bool) (*queryresult.SyncQueryResult, error)
- func (c *DbClient) GetCurrentSearchPath() ([]string, error)
- func (c *DbClient) LoadSchema()
- func (c *DbClient) RefreshConnectionAndSearchPaths() *steampipeconfig.RefreshConnectionResult
- func (c *DbClient) SchemaMetadata() *schema.Metadata
- func (c *DbClient) SetEnsureSessionDataFunc(f db_common.EnsureSessionStateCallback)
- func (c *DbClient) SetSessionSearchPath(currentSearchPath ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbClient ¶
type DbClient struct {
// contains filtered or unexported fields
}
DbClient wraps over `sql.DB` and gives an interface to the database
func NewDbClient ¶
func (*DbClient) Close ¶
Close implements Client closes the connection to the database and shuts down the backend
func (*DbClient) ConnectionMap ¶
func (c *DbClient) ConnectionMap() *steampipeconfig.ConnectionDataMap
func (*DbClient) Execute ¶
func (c *DbClient) Execute(ctx context.Context, query string, disableSpinner bool) (res *queryresult.Result, err error)
Execute implements Client execute the provided query against the Database in the given context.Context Bear in mind that whenever ExecuteQuery is called, the returned `queryresult.Result` MUST be fully read - otherwise the transaction is left open, which will block the connection and will prevent subsequent communications with the service
func (*DbClient) ExecuteSync ¶
func (c *DbClient) ExecuteSync(ctx context.Context, query string, disableSpinner bool) (*queryresult.SyncQueryResult, error)
ExecuteSync implements Client execute a query against this client and wait for the result
func (*DbClient) GetCurrentSearchPath ¶
GetCurrentSearchPath implements Client query the database to get the current search path
func (*DbClient) LoadSchema ¶
func (c *DbClient) LoadSchema()
LoadSchema implements Client retrieve both the raw query result and a sanitised version in list form
func (*DbClient) RefreshConnectionAndSearchPaths ¶
func (c *DbClient) RefreshConnectionAndSearchPaths() *steampipeconfig.RefreshConnectionResult
RefreshConnectionAndSearchPaths implements Client
func (*DbClient) SchemaMetadata ¶
SchemaMetadata implements Client return the latest schema metadata
func (*DbClient) SetEnsureSessionDataFunc ¶
func (c *DbClient) SetEnsureSessionDataFunc(f db_common.EnsureSessionStateCallback)
func (*DbClient) SetSessionSearchPath ¶
SetSessionSearchPath implements Client sets the search path for this client if either a search-path or search-path-prefix is set in config, set the search path (otherwise fall back to user search path)