Table of Contents

Class NpgsqlIndexExtensions

Namespace
Microsoft.EntityFrameworkCore
Assembly
Npgsql.EntityFrameworkCore.PostgreSQL.dll

Extension methods for IIndex for Npgsql-specific metadata.

public static class NpgsqlIndexExtensions
Inheritance
NpgsqlIndexExtensions
Inherited Members

Methods

GetAreNullsDistinct(IReadOnlyIndex)

Returns whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column.

public static bool? GetAreNullsDistinct(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

Returns

bool?

Remarks

GetAreNullsDistinctConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for whether nulls are considered distinct.

public static ConfigurationSource? GetAreNullsDistinctConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource.

GetCollation(IReadOnlyIndex)

Returns the column collations to be used, or null if they have not been specified.

public static IReadOnlyList<string>? GetCollation(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

Returns

IReadOnlyList<string>

Remarks

GetCollationConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index collations.

public static ConfigurationSource? GetCollationConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource for the index collations.

GetIncludeProperties(IReadOnlyIndex)

Returns included property names, or null if they have not been specified.

public static IReadOnlyList<string>? GetIncludeProperties(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

The index.

Returns

IReadOnlyList<string>

The included property names, or null if they have not been specified.

GetIncludePropertiesConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the included property names.

public static ConfigurationSource? GetIncludePropertiesConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource for the included property names.

GetIsCreatedConcurrentlyConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for whether the index is created concurrently.

public static ConfigurationSource? GetIsCreatedConcurrentlyConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource for whether the index is created concurrently.

GetMethod(IReadOnlyIndex)

Returns the index method to be used, or null if it hasn't been specified. null selects the default (currently btree).

public static string? GetMethod(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

Returns

string

Remarks

GetMethodConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index method.

public static ConfigurationSource? GetMethodConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource for the index method.

GetNullSortOrder(IReadOnlyIndex)

Returns the column NULL sort orders to be used, or null if they have not been specified.

public static IReadOnlyList<NullSortOrder>? GetNullSortOrder(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

Returns

IReadOnlyList<NullSortOrder>

Remarks

GetNullSortOrderConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index null sort orders.

public static ConfigurationSource? GetNullSortOrderConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource for the index null sort orders.

GetOperators(IReadOnlyIndex)

Returns the column operators to be used, or null if they have not been specified.

public static IReadOnlyList<string>? GetOperators(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

Returns

IReadOnlyList<string>

Remarks

GetOperatorsConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index operators.

public static ConfigurationSource? GetOperatorsConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource for the index operators.

GetStorageParameter(IIndex, string)

Gets a storage parameter for the index.

public static string? GetStorageParameter(this IIndex index, string parameterName)

Parameters

index IIndex
parameterName string

Returns

string

GetStorageParameterConfigurationSource(IConventionIndex, string)

Gets the configuration source for a storage parameter for the table mapped to the entity type.

public static ConfigurationSource? GetStorageParameterConfigurationSource(this IConventionIndex index, string parameterName)

Parameters

index IConventionIndex
parameterName string

Returns

ConfigurationSource?

GetStorageParameters(IReadOnlyIndex)

Gets all storage parameters for the index.

public static Dictionary<string, object?> GetStorageParameters(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

Returns

Dictionary<string, object>

GetTsVectorConfig(IReadOnlyIndex)

Returns the text search configuration for this tsvector expression index, or null if this is not a tsvector expression index.

public static string? GetTsVectorConfig(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

The index.

Returns

string

Remarks

GetTsVectorConfigConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the tsvector config.

public static ConfigurationSource? GetTsVectorConfigConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The ConfigurationSource for the tsvector config.

IsCreatedConcurrently(IReadOnlyIndex)

Returns a value indicating whether the index is created concurrently.

public static bool? IsCreatedConcurrently(this IReadOnlyIndex index)

Parameters

index IReadOnlyIndex

The index.

Returns

bool?

true if the index is created concurrently.

SetAreNullsDistinct(IConventionIndex, bool?, bool)

Sets whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column.

public static bool? SetAreNullsDistinct(this IConventionIndex index, bool? nullsDistinct, bool fromDataAnnotation = false)

Parameters

index IConventionIndex
nullsDistinct bool?
fromDataAnnotation bool

Returns

bool?

Remarks

SetAreNullsDistinct(IMutableIndex, bool?)

Sets whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column.

public static void SetAreNullsDistinct(this IMutableIndex index, bool? nullsDistinct)

Parameters

index IMutableIndex
nullsDistinct bool?

Remarks

SetCollation(IConventionIndex, IReadOnlyList<string>?, bool)

Sets the column collations to be used, or null if they have not been specified.

public static IReadOnlyList<string>? SetCollation(this IConventionIndex index, IReadOnlyList<string>? collations, bool fromDataAnnotation = false)

Parameters

index IConventionIndex
collations IReadOnlyList<string>
fromDataAnnotation bool

Returns

IReadOnlyList<string>

Remarks

SetCollation(IMutableIndex, IReadOnlyList<string>?)

Sets the column collations to be used, or null if they have not been specified.

public static void SetCollation(this IMutableIndex index, IReadOnlyList<string>? collations)

Parameters

index IMutableIndex
collations IReadOnlyList<string>

Remarks

SetIncludeProperties(IConventionIndex, IReadOnlyList<string>?, bool)

Sets included property names.

public static IReadOnlyList<string>? SetIncludeProperties(this IConventionIndex index, IReadOnlyList<string>? properties, bool fromDataAnnotation = false)

Parameters

index IConventionIndex

The index.

properties IReadOnlyList<string>

The value to set.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IReadOnlyList<string>

SetIncludeProperties(IMutableIndex, IReadOnlyList<string>?)

Sets included property names.

public static void SetIncludeProperties(this IMutableIndex index, IReadOnlyList<string>? properties)

Parameters

index IMutableIndex

The index.

properties IReadOnlyList<string>

The value to set.

SetIsCreatedConcurrently(IConventionIndex, bool?, bool)

Sets a value indicating whether the index is created concurrently.

public static bool? SetIsCreatedConcurrently(this IConventionIndex index, bool? createdConcurrently, bool fromDataAnnotation = false)

Parameters

index IConventionIndex

The index.

createdConcurrently bool?

The value to set.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool?

SetIsCreatedConcurrently(IMutableIndex, bool?)

Sets a value indicating whether the index is created concurrently.

public static void SetIsCreatedConcurrently(this IMutableIndex index, bool? createdConcurrently)

Parameters

index IMutableIndex

The index.

createdConcurrently bool?

The value to set.

SetMethod(IConventionIndex, string?, bool)

Sets the index method to be used, or null if it hasn't been specified. null selects the default (currently btree).

public static string? SetMethod(this IConventionIndex index, string? method, bool fromDataAnnotation = false)

Parameters

index IConventionIndex
method string
fromDataAnnotation bool

Returns

string

Remarks

SetMethod(IMutableIndex, string?)

Sets the index method to be used, or null if it hasn't been specified. null selects the default (currently btree).

public static void SetMethod(this IMutableIndex index, string? method)

Parameters

index IMutableIndex
method string

Remarks

SetNullSortOrder(IConventionIndex, IReadOnlyList<NullSortOrder>?, bool)

Sets the column NULL sort orders to be used, or null if they have not been specified.

public static IReadOnlyList<NullSortOrder>? SetNullSortOrder(this IConventionIndex index, IReadOnlyList<NullSortOrder>? nullSortOrder, bool fromDataAnnotation = false)

Parameters

index IConventionIndex
nullSortOrder IReadOnlyList<NullSortOrder>
fromDataAnnotation bool

Returns

IReadOnlyList<NullSortOrder>

Remarks

SetNullSortOrder(IMutableIndex, IReadOnlyList<NullSortOrder>?)

Sets the column NULL sort orders to be used, or null if they have not been specified.

public static void SetNullSortOrder(this IMutableIndex index, IReadOnlyList<NullSortOrder>? nullSortOrder)

Parameters

index IMutableIndex
nullSortOrder IReadOnlyList<NullSortOrder>

Remarks

SetOperators(IConventionIndex, IReadOnlyList<string>?, bool)

Sets the column operators to be used, or null if they have not been specified.

public static IReadOnlyList<string>? SetOperators(this IConventionIndex index, IReadOnlyList<string>? operators, bool fromDataAnnotation = false)

Parameters

index IConventionIndex
operators IReadOnlyList<string>
fromDataAnnotation bool

Returns

IReadOnlyList<string>

Remarks

SetOperators(IMutableIndex, IReadOnlyList<string>?)

Sets the column operators to be used, or null if they have not been specified.

public static void SetOperators(this IMutableIndex index, IReadOnlyList<string>? operators)

Parameters

index IMutableIndex
operators IReadOnlyList<string>

Remarks

SetStorageParameter(IConventionIndex, string, object?, bool)

Sets a storage parameter on the index.

public static object SetStorageParameter(this IConventionIndex index, string parameterName, object? parameterValue, bool fromDataAnnotation = false)

Parameters

index IConventionIndex
parameterName string
parameterValue object
fromDataAnnotation bool

Returns

object

SetStorageParameter(IMutableIndex, string, object?)

Sets a storage parameter on the index.

public static void SetStorageParameter(this IMutableIndex index, string parameterName, object? parameterValue)

Parameters

index IMutableIndex
parameterName string
parameterValue object

SetTsVectorConfig(IConventionIndex, string?, bool)

Sets the index to tsvector config name to be used.

public static string? SetTsVectorConfig(this IConventionIndex index, string? config, bool fromDataAnnotation = false)

Parameters

index IConventionIndex

The index.

config string

The text search configuration for this generated tsvector property, or null if this is not a generated tsvector property.

See https://www.postgresql.org/docs/current/textsearch-controls.html for more information.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

string

Remarks

SetTsVectorConfig(IMutableIndex, string?)

Sets the text search configuration for this tsvector expression index, or null if this is not a tsvector expression index.

public static void SetTsVectorConfig(this IMutableIndex index, string? config)

Parameters

index IMutableIndex

The index.

config string

The text search configuration for this generated tsvector property, or null if this is not a generated tsvector property.

See https://www.postgresql.org/docs/current/textsearch-controls.html for more information.

Remarks