Struct SqlNodeInterpreterContextSnapshot
- Namespace
- LfrlAnvil.Sql.Expressions.Visitors
- Assembly
- LfrlAnvil.Sql.Core.dll
Represents a snapshot of an SqlNodeInterpreterContext state.
public readonly struct SqlNodeInterpreterContextSnapshot
- Inherited Members
Properties
Parameters
Collection of SQL parameter nodes.
public ReadOnlySpan<SqlParameterNode> Parameters { get; }
Property Value
Sql
Underlying SQL statement.
public string Sql { get; }
Property Value
Methods
Replace(SqlConditionPlaceholderNode, SqlNodeInterpreterContext)
Replaces provided placeholder node in this snapshot with the provided replacement's SQL.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlConditionPlaceholderNode node, SqlNodeInterpreterContext replacement)
Parameters
nodeSqlConditionPlaceholderNodeNode to replace.
replacementSqlNodeInterpreterContextContext to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlConditionPlaceholderNode, SqlNodeInterpreterContextSnapshot)
Replaces provided placeholder node in this snapshot
with the provided replacement snapshot's SQL.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlConditionPlaceholderNode node, SqlNodeInterpreterContextSnapshot replacement)
Parameters
nodeSqlConditionPlaceholderNodeNode to replace.
replacementSqlNodeInterpreterContextSnapshotContext to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlConditionPlaceholderNode, string)
Replaces provided placeholder node in this snapshot with the provided replacementSql.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlConditionPlaceholderNode node, string replacementSql)
Parameters
nodeSqlConditionPlaceholderNodeNode to replace.
replacementSqlstringText to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlExpressionPlaceholderNode, SqlNodeInterpreterContext)
Replaces provided placeholder node in this snapshot with the provided replacement's SQL.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlExpressionPlaceholderNode node, SqlNodeInterpreterContext replacement)
Parameters
nodeSqlExpressionPlaceholderNodeNode to replace.
replacementSqlNodeInterpreterContextContext to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlExpressionPlaceholderNode, SqlNodeInterpreterContextSnapshot)
Replaces provided placeholder node in this snapshot
with the provided replacement snapshot's SQL.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlExpressionPlaceholderNode node, SqlNodeInterpreterContextSnapshot replacement)
Parameters
nodeSqlExpressionPlaceholderNodeNode to replace.
replacementSqlNodeInterpreterContextSnapshotContext to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlExpressionPlaceholderNode, string)
Replaces provided placeholder node in this snapshot with the provided replacementSql.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlExpressionPlaceholderNode node, string replacementSql)
Parameters
nodeSqlExpressionPlaceholderNodeNode to replace.
replacementSqlstringText to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlSortTraitPlaceholderNode, SqlNodeInterpreterContext)
Replaces provided placeholder node in this snapshot with the provided replacement's SQL.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlSortTraitPlaceholderNode node, SqlNodeInterpreterContext replacement)
Parameters
nodeSqlSortTraitPlaceholderNodeNode to replace.
replacementSqlNodeInterpreterContextContext to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlSortTraitPlaceholderNode, SqlNodeInterpreterContextSnapshot)
Replaces provided placeholder node in this snapshot
with the provided replacement snapshot's SQL.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlSortTraitPlaceholderNode node, SqlNodeInterpreterContextSnapshot replacement)
Parameters
nodeSqlSortTraitPlaceholderNodeNode to replace.
replacementSqlNodeInterpreterContextSnapshotContext to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Replace(SqlSortTraitPlaceholderNode, string)
Replaces provided placeholder node in this snapshot with the provided replacementSql.
[Pure]
public SqlNodeInterpreterContextSnapshot Replace(SqlSortTraitPlaceholderNode node, string replacementSql)
Parameters
nodeSqlSortTraitPlaceholderNodeNode to replace.
replacementSqlstringText to replace the placeholder with.
Returns
- SqlNodeInterpreterContextSnapshot
New context snapshot with replaced placeholder.
Restore()
Creates a new SqlNodeInterpreterContext from this snapshot.
[Pure]
public SqlNodeInterpreterContext Restore()
Returns
- SqlNodeInterpreterContext
New SqlNodeInterpreterContext instance.
ToCondition()
Creates a new SqlRawConditionNode instance from this snapshot.
[Pure]
public SqlRawConditionNode ToCondition()
Returns
- SqlRawConditionNode
New SqlRawConditionNode instance.
ToExpression(TypeNullability?)
Creates a new SqlRawExpressionNode instance from this snapshot.
[Pure]
public SqlRawExpressionNode ToExpression(TypeNullability? type = null)
Parameters
typeTypeNullability?Optional runtime type of the result of this expression.
Returns
- SqlRawExpressionNode
New SqlRawExpressionNode instance.
ToQuery()
Creates a new SqlRawQueryExpressionNode instance from this snapshot.
[Pure]
public SqlRawQueryExpressionNode ToQuery()
Returns
- SqlRawQueryExpressionNode
New SqlRawQueryExpressionNode instance.
ToStatement()
Creates a new SqlRawStatementNode instance from this snapshot.
[Pure]
public SqlRawStatementNode ToStatement()
Returns
- SqlRawStatementNode
New SqlRawStatementNode instance.
ToString()
Returns a string representation of this SqlNodeInterpreterContextSnapshot instance.
[Pure]
public override string ToString()
Returns
- string
String representation.