Class QueryExecutionHelper
Provides centralized validation for SQL execution policy enforcement in the reporting web layer. The helper inspects query text, strips literals and comments, evaluates permission-tier rules, identifies dangerous execution patterns, and compresses violations into a single user-facing message.
Inheritance
Inherited Members
Namespace: BoldReports.Data
Assembly: BoldReports.Web.dll
Syntax
public static class QueryExecutionHelper
Methods
HasRestrictionCommands(String, QueryExecutionPolicy, String, out String)
Validates the query text against the supplied policy and, when restricted, compresses all collected violations into a single error message.
Declaration
public static bool HasRestrictionCommands(string query, QueryExecutionPolicy policy, string connector, out string error)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | The raw SQL query text, including comments or literal values. |
| QueryExecutionPolicy | policy | The execution policy to apply; a null or disabled policy allows everything. |
| System.String | connector | The provider identifier used for provider-specific allow and ignore checks. |
| System.String | error | Receives the aggregated violation message when the query is restricted; otherwise, an empty string. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True when the query violates the configured policy; otherwise, false. |