Table of Contents

Class PgUnnestExpression

Namespace
Npgsql.EntityFrameworkCore.PostgreSQL.Query.Expressions.Internal
Assembly
Npgsql.EntityFrameworkCore.PostgreSQL.dll

An expression that represents a PostgreSQL unnest function call in a SQL tree.

public class PgUnnestExpression : PgTableValuedFunctionExpression, IRelationalQuotableExpression, IPrintableExpression, ITableBasedExpression, IEquatable<PgTableValuedFunctionExpression>
Inheritance
PgUnnestExpression
Implements
Inherited Members

Remarks

This expression is just a PgTableValuedFunctionExpression, adding the ability to provide an explicit column name for its output (SELECT * FROM unnest(array) AS f(foo)). This is necessary since when the column name isn't explicitly specified, it is automatically identical to the table alias (f above); since the table alias may get uniquified by EF, this would break queries.

See unnest for more information and examples.

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Constructors

PgUnnestExpression(string, SqlExpression, string, bool)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public PgUnnestExpression(string alias, SqlExpression array, string columnName, bool withOrdinality = true)

Parameters

alias string
array SqlExpression
columnName string
withOrdinality bool

Properties

Array

The array to be un-nested into a table.

public virtual SqlExpression Array { get; }

Property Value

SqlExpression

Remarks

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

ColumnName

The name of the column to be projected out from the unnest call.

public virtual string ColumnName { get; }

Property Value

string

Remarks

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Methods

Clone(string?, ExpressionVisitor)

Creates a new object that is a copy of the current instance.

public override TableExpressionBase Clone(string? alias, ExpressionVisitor cloningExpressionVisitor)

Parameters

alias string

The alias to be used by the cloned table.

cloningExpressionVisitor ExpressionVisitor

The cloning expression for further visitation of nested nodes.

Returns

TableExpressionBase

A new object that is a copy of this instance.

Update(SqlExpression)

Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.

public virtual PgUnnestExpression Update(SqlExpression array)

Parameters

array SqlExpression

The Array property of the result.

Returns

PgUnnestExpression

This expression if no children changed, or an expression with the updated children.

Update(IReadOnlyList<SqlExpression>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public override PgUnnestExpression Update(IReadOnlyList<SqlExpression> arguments)

Parameters

arguments IReadOnlyList<SqlExpression>

Returns

PgUnnestExpression

VisitChildren(ExpressionVisitor)

Reduces the node and then calls the visitor delegate on the reduced expression. The method throws an exception if the node is not reducible.

protected override Expression VisitChildren(ExpressionVisitor visitor)

Parameters

visitor ExpressionVisitor

An instance of Func<T, TResult>.

Returns

Expression

The expression being visited, or an expression which should replace it in the tree.

WithAlias(string)

Returns a copy of the current TableExpressionBase with the new provided alias.

public override PgUnnestExpression WithAlias(string newAlias)

Parameters

newAlias string

The alias to apply to the returned TableExpressionBase.

Returns

PgUnnestExpression

WithColumnInfos(IReadOnlyList<ColumnInfo>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public override PgUnnestExpression WithColumnInfos(IReadOnlyList<PgTableValuedFunctionExpression.ColumnInfo> columnInfos)

Parameters

columnInfos IReadOnlyList<PgTableValuedFunctionExpression.ColumnInfo>

Returns

PgUnnestExpression