Table of Contents

Class SqlStatement

Namespace
LinqToDB.SqlQuery
Assembly
linq2db.dll
public abstract class SqlStatement : IQueryElement, ISqlExpressionWalkable
Inheritance
SqlStatement
Implements
Derived
Extension Methods

Properties

DebugSqlText

protected string DebugSqlText { get; }

Property Value

string

ElementType

public abstract QueryElementType ElementType { get; }

Property Value

QueryElementType

IsParameterDependent

public abstract bool IsParameterDependent { get; set; }

Property Value

bool

ParentStatement

Used internally for SQL Builder

public SqlStatement? ParentStatement { get; set; }

Property Value

SqlStatement

QueryType

public abstract QueryType QueryType { get; }

Property Value

QueryType

SelectQuery

public abstract SelectQuery? SelectQuery { get; set; }

Property Value

SelectQuery

SqlQueryExtensions

public List<SqlQueryExtension>? SqlQueryExtensions { get; set; }

Property Value

List<SqlQueryExtension>

SqlText

public string SqlText { get; }

Property Value

string

Tag

public SqlComment? Tag { get; }

Property Value

SqlComment

Methods

CollectParameters()

[Obsolete("API will be removed in future versions")]
public SqlParameter[] CollectParameters()

Returns

SqlParameter[]

GetTableSource(ISqlTableSource)

public abstract ISqlTableSource? GetTableSource(ISqlTableSource table)

Parameters

table ISqlTableSource

Returns

ISqlTableSource

IsDependedOn(SqlTable)

Indicates when optimizer can not remove reference for particular table

public virtual bool IsDependedOn(SqlTable table)

Parameters

table SqlTable

Returns

bool

PrepareQueryAndAliases(SqlStatement, AliasesContext?, out AliasesContext)

public static void PrepareQueryAndAliases(SqlStatement statement, AliasesContext? prevAliasContext, out AliasesContext newAliasContext)

Parameters

statement SqlStatement
prevAliasContext AliasesContext
newAliasContext AliasesContext

ToString(StringBuilder, Dictionary<IQueryElement, IQueryElement>)

public abstract StringBuilder ToString(StringBuilder sb, Dictionary<IQueryElement, IQueryElement> dic)

Parameters

sb StringBuilder
dic Dictionary<IQueryElement, IQueryElement>

Returns

StringBuilder

WalkQueries<TContext>(TContext, Func<TContext, SelectQuery, SelectQuery>)

public abstract void WalkQueries<TContext>(TContext context, Func<TContext, SelectQuery, SelectQuery> func)

Parameters

context TContext
func Func<TContext, SelectQuery, SelectQuery>

Type Parameters

TContext

Walk<TContext>(WalkOptions, TContext, Func<TContext, ISqlExpression, ISqlExpression>)

public virtual ISqlExpression? Walk<TContext>(WalkOptions options, TContext context, Func<TContext, ISqlExpression, ISqlExpression> func)

Parameters

options WalkOptions
context TContext
func Func<TContext, ISqlExpression, ISqlExpression>

Returns

ISqlExpression

Type Parameters

TContext