Search Results for

    Show / Hide Table of Contents

    Enum NpgsqlValueGenerationStrategy

    Defines strategies to use when generating values for database columns.

    Namespace: Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
    Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
    Syntax
    public enum NpgsqlValueGenerationStrategy
    Remarks

    See Model building conventions.

    Fields

    Name Description
    IdentityAlwaysColumn

    Selects the always-identity column strategy (a value cannot be provided).

    Available only starting PostgreSQL 10.

    IdentityByDefaultColumn

    Selects the by-default-identity column strategy (a value can be provided to override the identity mechanism).

    Available only starting PostgreSQL 10.

    None

    No Npgsql-specific strategy.

    Sequence

    A pattern that uses a database sequence to generate values for the column.

    SequenceHiLo

    A sequence-based hi-lo pattern where blocks of IDs are allocated from the server and used client-side for generating keys.

    This is an advanced pattern--only use this strategy if you are certain it is what you need.

    SerialColumn

    Selects the serial column strategy, which is a regular column backed by an auto-created index.

    If you are creating a new project on PostgreSQL 10 or above, consider using IdentityByDefaultColumn instead.

    Extension Methods

    NpgsqlValueGenerationStrategyExtensions.IsIdentity(NpgsqlValueGenerationStrategy)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team