Class SqlRecordSetNode
- Namespace
- LfrlAnvil.Sql.Expressions.Objects
- Assembly
- LfrlAnvil.Sql.Core.dll
Represents an SQL syntax tree node that defines a single record set.
public abstract class SqlRecordSetNode : SqlNodeBase
- Inheritance
-
SqlRecordSetNode
- Derived
- Inherited Members
- Extension Methods
Constructors
SqlRecordSetNode(string?, bool)
Creates a new SqlRecordSetNode with Unknown type.
protected SqlRecordSetNode(string? alias, bool isOptional)
Parameters
Properties
Alias
Optional alias of this record set.
public string? Alias { get; }
Property Value
Identifier
Gets the internal identifier of this record set. This can be used to get a record set from a SqlMultiDataSourceNode.
public string Identifier { get; }
Property Value
Info
SqlRecordSetInfo associated with this record set.
public abstract SqlRecordSetInfo Info { get; }
Property Value
IsAliased
Specifies whether or not this record set is aliased.
public bool IsAliased { get; }
Property Value
IsOptional
Specifies whether or not this record set is marked as optional.
public bool IsOptional { get; }
Property Value
Remarks
Optional record sets will only contain nullable data fields.
this[string]
Gets a data field associated with this record set by its name.
public SqlDataFieldNode this[string fieldName] { get; }
Parameters
fieldName
stringName of the data field to get.
Property Value
Exceptions
- KeyNotFoundException
When data field does not exist.
Methods
As(string)
Creates a new SQL record set node with changed Alias.
[Pure]
public abstract SqlRecordSetNode As(string alias)
Parameters
alias
stringAlias to set.
Returns
- SqlRecordSetNode
New SQL record set node.
AsSelf()
Creates a new SQL record set node without an alias.
[Pure]
public abstract SqlRecordSetNode AsSelf()
Returns
- SqlRecordSetNode
New SQL record set node.
GetField(string)
Returns a data field associated with this record set by its name
.
[Pure]
public abstract SqlDataFieldNode GetField(string name)
Parameters
name
stringData field's name.
Returns
- SqlDataFieldNode
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 abstract IReadOnlyCollection<SqlDataFieldNode> GetKnownFields()
Returns
- IReadOnlyCollection<SqlDataFieldNode>
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 abstract SqlDataFieldNode GetUnsafeField(string name)
Parameters
name
stringData 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 abstract SqlRecordSetNode MarkAsOptional(bool optional = true)
Parameters
optional
boolIsOptional value to set. Equal to true by default.
Returns
- SqlRecordSetNode
New SQL record set node.