withCte method

A copy with cte appended to ctes.

Two expressions with the same name are refused where the statement is built, not here: the same walk added twice by two chained scopes is a mistake worth naming, and the compiler is where the name is in scope.

Implementation

MssqlQueryState withCte(MssqlTypedCte cte) => MssqlQueryState(
  scope: scope,
  where: where,
  orderBy: orderBy,
  options: options,
  ctes: <MssqlTypedCte>[...ctes, cte],
);