Files
steampipe/pkg/db/db_common/client.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

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)
}