Search Results for

    Show / Hide Table of Contents

    Class NpgsqlModificationCommandBatch

    The Npgsql-specific implementation for .

    Inheritance
    object
    NpgsqlModificationCommandBatch
    Namespace: Npgsql.EntityFrameworkCore.PostgreSQL.Update.Internal
    Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
    Syntax
    public class NpgsqlModificationCommandBatch : ReaderModificationCommandBatch
    Remarks

    The usual ModificationCommandBatch implementation is , which selects the number of rows modified via a SQL query.

    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 Source

    NpgsqlModificationCommandBatch(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 , which selects the number of rows modified via a SQL query.

    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 Source

    MaxBatchSize

    The maximum number of instances that can be added to a single batch; defaults to 1000.

    Declaration
    protected override int MaxBatchSize { get; }
    Property Value
    Type Description
    int
    Remarks

    The usual ModificationCommandBatch implementation is , which selects the number of rows modified via a SQL query.

    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 Source

    AddParameter(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 , which selects the number of rows modified via a SQL query.

    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).

    | Improve this Doc View Source

    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 , which selects the number of rows modified via a SQL query.

    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).

    | Improve this Doc View Source

    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 , which selects the number of rows modified via a SQL query.

    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).

    | Improve this Doc View Source

    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 , which selects the number of rows modified via a SQL query.

    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).

    | Improve this Doc View Source

    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 to observe while waiting for the task to complete.

    Returns
    Type Description
    Task

    A task that represents the asynchronous operation.

    Remarks

    The usual ModificationCommandBatch implementation is , which selects the number of rows modified via a SQL query.

    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).

    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team