Optionally, you can pass in a provider to use for running the query. If not provided, the static provider will be used.
Gets the query provider to use for execution. Returns the instance provider if set, otherwise falls back to the static provider.
The query provider instance
StaticProviderGets the static query provider instance. Used when no instance-specific provider is configured.
The global query provider
Sets the static query provider instance. This provider will be used by all RunQuery instances that don't have their own provider.
The query provider to set globally
Executes a query from a QueryExecutionSpec — the lower-layer interface-based entry point.
Runs the full pipeline: composition resolution → Nunjucks template processing → SQL execution.
Supports both saved queries (via QueryExecutionSpec.FromQueryInfo) and transient test queries.
The execution spec describing the query, parameters, and inline dependencies
OptionalcontextUser: UserInfoOptional user context for permissions (mainly used server-side)
Query results including data rows and execution metadata
Executes multiple queries in a single batch operation. More efficient than calling RunQuery multiple times as it reduces network overhead and allows the database to execute queries in parallel.
Array of query parameters, each specifying a query to execute
OptionalcontextUser: UserInfoOptional user context for permissions (mainly used server-side)
Array of query results in the same order as the input params
Executes a saved query and returns the results. The query must exist in the system and the user must have permission to execute it. Queries can be identified by QueryID or by QueryName + CategoryPath combination. CategoryPath supports hierarchical navigation (e.g., "/MJ/AI/Agents/") and falls back to simple name matching.
Parameters including query ID or name with optional CategoryPath for disambiguation
OptionalcontextUser: UserInfoOptional user context for permissions (mainly used server-side)
Query results including data rows and execution metadata
Class used to run a query and return the results. Provides an abstraction layer for executing saved queries with proper security checks. Supports both instance-based and static provider patterns.