workspace

package
v0.13.0-alpha.15 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureSessionData added in v0.8.3

func EnsureSessionData(ctx context.Context, source *SessionDataSource, session *db_common.DatabaseSession) (err error, warnings []string)

EnsureSessionData determines whether session scoped data (introspection tables and prepared statements) exists for this session, and if not, creates it

func LoadResourceNames added in v0.8.0

func LoadResourceNames(workspacePath string) (*modconfig.WorkspaceResources, error)

LoadResourceNames builds lists of all workspace resource names

Types

type SessionDataSource added in v0.8.3

type SessionDataSource struct {
	PreparedStatementSource  func() *modconfig.WorkspaceResourceMaps
	IntrospectionTableSource func() *modconfig.WorkspaceResourceMaps
}

func NewSessionDataSource added in v0.8.3

func NewSessionDataSource(w *Workspace, preparedStatementSource *modconfig.WorkspaceResourceMaps) *SessionDataSource

TODO [report] change this to accept a list of queries instead of and create the cut down preparedStatementSource here NewSessionDataSource uses the workspace and (optionally) a separate the prepared statemeot source and returns a SessionDataSource NOTE: preparedStatementSource is only set if specific queries have ben passed to the query command it allows us to only create the prepared statements me need

type Workspace

type Workspace struct {
	Path                string
	ModInstallationPath string
	Mod                 *modconfig.Mod

	Mods      map[string]*modconfig.Mod
	Variables map[string]*modconfig.Variable
	// contains filtered or unexported fields
}

func Load

func Load(ctx context.Context, workspacePath string) (*Workspace, error)

Load creates a Workspace and loads the workspace mod

func (*Workspace) CheckRequiredPluginsInstalled added in v0.6.0

func (w *Workspace) CheckRequiredPluginsInstalled() error

func (*Workspace) Close

func (w *Workspace) Close()

func (*Workspace) GetControl added in v0.6.1

func (w *Workspace) GetControl(controlName string) (*modconfig.Control, bool)

func (*Workspace) GetQueriesFromArgs added in v0.8.0

func (w *Workspace) GetQueriesFromArgs(args []string) ([]string, *modconfig.WorkspaceResourceMaps, error)

GetQueriesFromArgs retrieves queries from args

For each arg check if it is a named query or a file, before falling back to treating it as sql

func (*Workspace) GetQuery added in v0.6.1

func (w *Workspace) GetQuery(queryName string) (*modconfig.Query, bool)

func (*Workspace) GetResourceMaps added in v0.5.0

func (w *Workspace) GetResourceMaps() *modconfig.WorkspaceResourceMaps

GetResourceMaps implements ResourceMapsProvider

func (*Workspace) PublishDashboardEvent added in v0.13.0

func (w *Workspace) PublishDashboardEvent(e dashboardevents.DashboardEvent)

func (*Workspace) RegisterDashboardEventHandler added in v0.13.0

func (w *Workspace) RegisterDashboardEventHandler(handler dashboardevents.DashboardEventHandler)

func (*Workspace) ResolveQueryAndArgsFromSQLString added in v0.13.0

func (w *Workspace) ResolveQueryAndArgsFromSQLString(sqlString string) (string, modconfig.QueryProvider, error)

ResolveQueryAndArgsFromSQLString attempts to resolve 'arg' to a query and query args

func (*Workspace) ResolveQueryFromQueryProvider added in v0.13.0

func (w *Workspace) ResolveQueryFromQueryProvider(queryProvider modconfig.QueryProvider, runtimeArgs *modconfig.QueryArgs) (string, error)

ResolveQueryFromQueryProvider resolves the query for the given QueryProvider

func (*Workspace) SetOnFileWatcherEventMessages added in v0.10.0

func (w *Workspace) SetOnFileWatcherEventMessages(f func())

func (*Workspace) SetupWatcher

func (w *Workspace) SetupWatcher(ctx context.Context, client db_common.Client, errorHandler func(context.Context, error)) error

Jump to

Keyboard shortcuts

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