mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-21 11:00:21 -05:00
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
35 lines
1.2 KiB
Go
35 lines
1.2 KiB
Go
package db_common
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
|
|
"github.com/turbot/steampipe/pkg/query/queryresult"
|
|
"github.com/turbot/steampipe/pkg/schema"
|
|
)
|
|
|
|
type Client interface {
|
|
Close(ctx context.Context) error
|
|
|
|
ForeignSchemaNames() []string
|
|
AllSchemaNames() []string
|
|
LoadSchemaNames(ctx context.Context) error
|
|
|
|
GetCurrentSearchPath(context.Context) ([]string, error)
|
|
GetCurrentSearchPathForDbConnection(context.Context, *sql.Conn) ([]string, error)
|
|
SetRequiredSessionSearchPath(context.Context) error
|
|
GetRequiredSessionSearchPath() []string
|
|
ConstructSearchPath(context.Context, []string, []string) ([]string, error)
|
|
|
|
AcquireSession(context.Context) *AcquireSessionResult
|
|
|
|
ExecuteSync(context.Context, string, ...any) (*queryresult.SyncQueryResult, error)
|
|
Execute(context.Context, string, ...any) (*queryresult.Result, error)
|
|
|
|
ExecuteSyncInSession(context.Context, *DatabaseSession, string, ...any) (*queryresult.SyncQueryResult, error)
|
|
ExecuteInSession(context.Context, *DatabaseSession, func(), string, ...any) (*queryresult.Result, error)
|
|
|
|
RefreshSessions(ctx context.Context) *AcquireSessionResult
|
|
GetSchemaFromDB(context.Context, ...string) (*schema.Metadata, error)
|
|
}
|