Class NpgsqlModificationCommandBatch
The Npgsql-specific implementation for
Inheritance
Namespace: Npgsql.EntityFrameworkCore.PostgreSQL.Update.Internal
Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
Syntax
public class NpgsqlModificationCommandBatch : ReaderModificationCommandBatch
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).
Constructors
| Improve this Doc View SourceNpgsqlModificationCommandBatch(ModificationCommandBatchFactoryDependencies, int)
Constructs an instance of the NpgsqlModificationCommandBatch class.
Declaration
public NpgsqlModificationCommandBatch(ModificationCommandBatchFactoryDependencies dependencies, int maxBatchSize)
Parameters
Type | Name | Description |
---|---|---|
ModificationCommandBatchFactoryDependencies | dependencies | |
int | maxBatchSize |
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).
Properties
| Improve this Doc View SourceMaxBatchSize
The maximum number of
Declaration
protected override int MaxBatchSize { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).
Methods
| Improve this Doc View SourceAddParameter(IColumnModification)
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.
Declaration
protected override void AddParameter(IColumnModification columnModification)
Parameters
Type | Name | Description |
---|---|---|
IColumnModification | columnModification |
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).
Consume(RelationalDataReader)
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.
Declaration
protected override void Consume(RelationalDataReader reader)
Parameters
Type | Name | Description |
---|---|---|
RelationalDataReader | reader |
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).
ConsumeAsync(RelationalDataReader, CancellationToken)
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.
Declaration
protected override Task ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
RelationalDataReader | reader | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).
ThrowAggregateUpdateConcurrencyException(RelationalDataReader, int, int, int)
Throws an exception indicating the command affected an unexpected number of rows.
Declaration
protected virtual void ThrowAggregateUpdateConcurrencyException(RelationalDataReader reader, int commandIndex, int expectedRowsAffected, int rowsAffected)
Parameters
Type | Name | Description |
---|---|---|
RelationalDataReader | reader | The data reader. |
int | commandIndex | The ordinal of the command. |
int | expectedRowsAffected | The expected number of rows affected. |
int | rowsAffected | The actual number of rows affected. |
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).
ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader, int, int, int, CancellationToken)
Throws an exception indicating the command affected an unexpected number of rows.
Declaration
protected virtual Task ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, int commandIndex, int expectedRowsAffected, int rowsAffected, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RelationalDataReader | reader | The data reader. |
int | commandIndex | The ordinal of the command. |
int | expectedRowsAffected | The expected number of rows affected. |
int | rowsAffected | The actual number of rows affected. |
CancellationToken | cancellationToken | A |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
Remarks
The usual ModificationCommandBatch implementation is
PostgreSQL actually has no way of selecting the modified row count. SQL defines GET DIAGNOSTICS which should provide this, but in PostgreSQL it's only available in PL/pgSQL. See http://www.postgresql.org/docs/9.4/static/unsupported-features-sql-standard.html, identifier F121-01.
Instead, the affected row count can be accessed in the PostgreSQL protocol itself, which seems cleaner and more efficient anyway (no additional query).