Table of Contents

Class SqlObjectNameExpression

Namespace
LinqToDB.Internal.SqlQuery
Assembly
linq2db.dll

A database object name (table / sequence / trigger / field) that renders with a specific ConvertType. Lets a SqlFragment — and thus a SqlRawStatement — carry a correctly-quoted derived name (e.g. an identity sequence SIDENTITY_<table>) whose quoting is only available in the SQL builder.

public sealed class SqlObjectNameExpression : SqlExpressionBase, ISqlExpression, IQueryElement, IEquatable<ISqlExpression>
Inheritance
object
SqlObjectNameExpression
Implements
Inherited Members
Extension Methods

Remarks

Produced server-side during scenario render (never present in a client-serialized statement), so it is intentionally not handled by LinqServiceSerializer — remote serialization of it would throw.

Constructors

SqlObjectNameExpression(SqlObjectName, ConvertType, TableOptions, bool)

Creates an object-name expression for name rendered with convertType.

public SqlObjectNameExpression(SqlObjectName name, ConvertType convertType, TableOptions tableOptions = TableOptions.NotSet, bool insideStringLiteral = false)

Parameters

name SqlObjectName
convertType ConvertType
tableOptions TableOptions
insideStringLiteral bool

Properties

ConvertType

How the builder should quote/convert Name (table, sequence, trigger, …).

public ConvertType ConvertType { get; }

Property Value

ConvertType

ElementType

AST node type.

public override QueryElementType ElementType { get; }

Property Value

QueryElementType

InsideStringLiteral

Whether the fragment holding this placeholder puts it inside a SQL string literal, as Oracle's EXECUTE IMMEDIATE '…' blocks do. Identifier quoting alone does not survive that position: an apostrophe in the name would close the enclosing literal and the rest would be parsed as code, so the builder additionally escapes the rendered name for literal-body position. The literal's own delimiters stay in the fragment's format string - only the body is escaped.

public bool InsideStringLiteral { get; }

Property Value

bool

Name

The database object name to render.

public SqlObjectName Name { get; }

Property Value

SqlObjectName

Precedence

public override int Precedence { get; }

Property Value

int

SystemType

public override Type? SystemType { get; }

Property Value

Type

TableOptions

Table options influencing the rendered name (e.g. temporary-table qualification).

public TableOptions TableOptions { get; }

Property Value

TableOptions

Methods

Accept(QueryElementVisitor)

Visitor support.

public override IQueryElement Accept(QueryElementVisitor visitor)

Parameters

visitor QueryElementVisitor

Returns

IQueryElement

CanBeNullable(NullabilityContext)

public override bool CanBeNullable(NullabilityContext nullability)

Parameters

nullability NullabilityContext

Returns

bool

Equals(ISqlExpression, Func<ISqlExpression, ISqlExpression, bool>)

public override bool Equals(ISqlExpression other, Func<ISqlExpression, ISqlExpression, bool> comparer)

Parameters

other ISqlExpression
comparer Func<ISqlExpression, ISqlExpression, bool>

Returns

bool

GetElementHashCode()

public override int GetElementHashCode()

Returns

int

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToString(QueryElementTextWriter)

Generates debug text representation of AST node.

public override QueryElementTextWriter ToString(QueryElementTextWriter writer)

Parameters

writer QueryElementTextWriter

Returns

QueryElementTextWriter