Table of Contents

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

ReadOnlySpan<SqlParameterNode>

Sql

Underlying SQL statement.

public string Sql { get; }

Property Value

string

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

node SqlConditionPlaceholderNode

Node to replace.

replacement SqlNodeInterpreterContext

Context 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

node SqlConditionPlaceholderNode

Node to replace.

replacement SqlNodeInterpreterContextSnapshot

Context 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

node SqlConditionPlaceholderNode

Node to replace.

replacementSql string

Text 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

node SqlExpressionPlaceholderNode

Node to replace.

replacement SqlNodeInterpreterContext

Context 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

node SqlExpressionPlaceholderNode

Node to replace.

replacement SqlNodeInterpreterContextSnapshot

Context 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

node SqlExpressionPlaceholderNode

Node to replace.

replacementSql string

Text 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

node SqlSortTraitPlaceholderNode

Node to replace.

replacement SqlNodeInterpreterContext

Context 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

node SqlSortTraitPlaceholderNode

Node to replace.

replacement SqlNodeInterpreterContextSnapshot

Context 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

node SqlSortTraitPlaceholderNode

Node to replace.

replacementSql string

Text 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

type TypeNullability?

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.