db_client

package
v0.9.1-dev.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2021 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

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 NewDbClient(connectionString string) (*DbClient, error)

func (*DbClient) CacheClear

func (c *DbClient) CacheClear() error

CacheClear implements Client

func (*DbClient) CacheOff

func (c *DbClient) CacheOff() error

CacheOff implements Client

func (*DbClient) CacheOn

func (c *DbClient) CacheOn() error

CacheOn implements Client

func (*DbClient) Close

func (c *DbClient) Close() error

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

func (c *DbClient) GetCurrentSearchPath() ([]string, error)

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

func (c *DbClient) SchemaMetadata() *schema.Metadata

SchemaMetadata implements Client return the latest schema metadata

func (*DbClient) SetEnsureSessionDataFunc

func (c *DbClient) SetEnsureSessionDataFunc(f db_common.EnsureSessionStateCallback)

func (*DbClient) SetSessionSearchPath

func (c *DbClient) SetSessionSearchPath(currentSearchPath ...string) error

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL