Table of Contents

Class SqlViewBuilderNode

Namespace
LfrlAnvil.Sql.Expressions.Objects
Assembly
LfrlAnvil.Sql.Core.dll

Represents an SQL syntax tree node that defines a single record set based on an ISqlViewBuilder instance.

public sealed class SqlViewBuilderNode : SqlRecordSetNode
Inheritance
SqlViewBuilderNode
Inherited Members
Extension Methods

Properties

Info

SqlRecordSetInfo associated with this record set.

public override SqlRecordSetInfo Info { get; }

Property Value

SqlRecordSetInfo

this[string]

Gets a data field associated with this record set by its name.

public SqlQueryDataFieldNode this[string fieldName] { get; }

Parameters

fieldName string

Name of the data field to get.

Property Value

SqlQueryDataFieldNode

Exceptions

KeyNotFoundException

When data field does not exist.

View

Underlying ISqlViewBuilder instance.

public ISqlViewBuilder View { get; }

Property Value

ISqlViewBuilder

Methods

As(string)

Creates a new SQL record set node with changed Alias.

[Pure]
public override SqlViewBuilderNode As(string alias)

Parameters

alias string

Alias to set.

Returns

SqlViewBuilderNode

New SQL record set node.

AsSelf()

Creates a new SQL record set node without an alias.

[Pure]
public override SqlViewBuilderNode AsSelf()

Returns

SqlViewBuilderNode

New SQL record set node.

GetField(string)

Returns a data field associated with this record set by its name.

[Pure]
public override SqlQueryDataFieldNode GetField(string name)

Parameters

name string

Data field's name.

Returns

SqlQueryDataFieldNode

SqlDataFieldNode instance associated with the provided name.

Exceptions

KeyNotFoundException

When data field does not exist.

GetKnownFields()

Returns a collection of all known data fields that belong to this record set.

[Pure]
public override IReadOnlyCollection<SqlQueryDataFieldNode> GetKnownFields()

Returns

IReadOnlyCollection<SqlQueryDataFieldNode>

Collection of all known data fields that belong to this record set.

GetUnsafeField(string)

Returns an unsafe data field associated with this record set by its name. If a known data field by the provided name does not exist, then a new SqlRawDataFieldNode instance will be returned instead.

[Pure]
public override SqlDataFieldNode GetUnsafeField(string name)

Parameters

name string

Data field's name.

Returns

SqlDataFieldNode

SqlDataFieldNode instance associated with the provided name.

MarkAsOptional(bool)

Creates a new SQL record set node with changed IsOptional.

[Pure]
public override SqlViewBuilderNode MarkAsOptional(bool optional = true)

Parameters

optional bool

IsOptional value to set. Equal to true by default.

Returns

SqlViewBuilderNode

New SQL record set node.