StaticAssertThe full screen for one client clause fragment; throws when it refuses. The label OrderBy
screens the text as an ORDER BY list; any other label screens it as a WHERE predicate. When
user is given, every entity the fragment reads must be readable by that user, unscoped
(AssertUnscopedRead). That includes the entity the clause filters: a subquery over
its base view is outside the row filter RunView applies to the outer query.
The reads come from a walk of the whole parse tree (CollectStatementReads), and the clause is refused when that walk does not account for every SELECT in the text (AssertEverySelectAccountedFor). Only the parse wrapper's own FROM item is skipped, and no CTE reference is exempt. A name reserved for the parser (AssertNoIdentifierAliasNames) and a call to a function the dialect forbids (AssertNoForbiddenFunctionCalls) are refused first.
With LeaveUnparseableToProvider, text the parser cannot read returns without a refusal;
the caller's own per-item check must refuse it instead.
Optionaluser: UserInfoOptionaloptions: ClientClauseScreenOptionsStaticAssertRefuses SQL whose SELECT keywords, outside literals, quoted identifiers and comments, differ in number from the SELECT nodes a walk of its parse tree found. A subquery the walk cannot see would otherwise go unchecked, so a mismatch fails closed.
StaticAssertScreens a full client-supplied SQL statement (ad-hoc query path) so every table reference
resolves to an entity BaseView that user can read unscoped (CanRead, no row-level filter,
no denied fields), with in-scope CTE references permitted.
StaticAssertRefuses a call to a function the dialect forbids in caller-supplied SQL (SQLParserDialect.CallerSQLForbiddenFunctions). Such a function runs SQL given as a string, reads files or other databases, acts on the server, or pauses the query, so the table check cannot see what it reads.
StaticAssertRefuses an identifier, quoted or bare, in the form of a name the SQL parser gives a bracket identifier it renames (SQLParser.IsIdentifierAliasName), in any case. Those names are reserved for the parser, so client SQL may not use them.
StaticAssertThe entity one FROM item reads, or null for an unqualified built-in table function that reads only its arguments. Throws for any other function or row source, and when AssertTableRefReadable refuses a table name.
Optionaluser: UserInfoStaticAssertRefuses a statement separator or a comment outside literals and quoted identifiers. A filter or sort fragment never needs either, so this cannot refuse a legitimate clause.
StaticAssertThe full screen for a whole caller-written statement (ad-hoc SQL), run on the SQL as it will
execute: one read statement, no write or DDL at any depth, no name reserved for the parser,
every SELECT accounted for, and every FROM item that is not a CTE in scope an entity base view
user can read unscoped (AssertUnscopedRead). Base tables, system catalogs and table
functions are refused. Throws on the first refusal.
StaticAssertResolves a table reference against the allow-list and returns its entity; throws when it is
not an entity base view, or when user is given and lacks CanRead on that entity.
A schema-qualified reference, dbo included, must match an entity in that exact schema. An
unqualified one resolves only when the view name is unique across schemas, because the
database's default-schema resolution, not this screen, would pick which view runs.
Optionaluser: UserInfoStaticAssertRefuses an entity whose read user holds under a row filter (role row-level security or an
API-key row filter) or with denied fields. SQL that reads the entity's base view directly, such
as a subquery in a client clause or an ad-hoc query, applies neither; RunView on that entity
does. For any other entity, a granted read covers every row and field of its base view.
StaticAstTrue when a parsed AST contains a write or DDL node at any depth.
Use StrictFragmentValidator.ValidateReadOnlyStatement from
@memberjunction/sql-parser, whose result reports ContainsNestedWrite.
StaticBuildBuilds the base-view allow-list for a set of entities, including both each entity's
canonical BaseView and any registered, usable AlternateBaseViews (D13).
Disabled alternate base views (!abv.IsUsable) are excluded. Canonical BaseView
entries are registered first and never overwritten by alternate base views; cross-entity
collisions on (schema, viewName) map to null (fail-closed). Memoized per entity array:
reused while the array keeps its length and no EntityInfo has been built since (the
field-security generation, which moves on every build, so a refreshed or replaced entity
is noticed).
StaticCollectEvery FROM item in a parsed statement, and the number of SELECT nodes, from a walk of the
whole parse tree with CTE scope (StatementRelation.IsCTEReference); see
StrictFragmentValidator.CollectStatementReads in @memberjunction/sql-parser. skip
is a FROM item node of parser's own tree to leave out.
Optionalskip: objectStaticDialectThe parser dialect for a provider: from its PlatformKey when it has one, otherwise from its
class name. Defaults to SQL Server.
Optionalprovider: object | nullStaticIsTrue for a reference written with no schema. A schema, dbo included, is matched as written.
StaticScreenApplies AssertClauseUsesEntityBaseViews to every clause of a RunView request. A platform-specific clause has every variant screened, each under its own platform's dialect.
Optionaluser: UserInfoStaticStripRemoves the bracket, double-quote or backtick quoting around one identifier.
SECURITY — screens for SQL text that a client (or a client-saved record) supplies to RunView.
ClientClauseScreen.AssertClauseUsesEntityBaseViews is the full screen: one statement, parsed as a read-only fragment, that calls no function the dialect forbids in caller SQL and whose table references are only entity base views the acting user can read unscoped (no row filter and no denied fields). Base tables and system catalogs are refused. Apply it at every point where client text enters RunView: the GraphQL and REST entry points, ad-hoc list sources, and the clauses a saved view stores (at save and when the view runs).
ClientClauseScreen.AssertSingleStatementFragment is the light check the provider runs on every RunView, server-internal ones included: no statement separator and no comment outside a literal or quoted identifier. It cannot refuse a legitimate fragment, so it is safe for callers whose filters the full screen would refuse (base tables, entities the acting user cannot read).
Both use dialect-aware lexing, so a quote inside a bracket identifier (
[a']) or a PostgreSQLE'\''string cannot hide a statement the way it hides one from the keyword denylist.