Skip to content

DiGi.PostgreSQL.PartitionUniqueReference

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.PostgreSQL.PartitionUniqueReference Namespace

Classes

Modify Class

public static class Modify

Inheritance System.Object → Modify

Methods

Modify.CleanTypesAsync(NpgsqlConnection) Method

Cleans up unused types from the database by removing those that are not associated with any partition.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.PartitionUniqueReference.Classes.Type>?> CleanTypesAsync(Npgsql.NpgsqlConnection? npgsqlConnection);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The connection to the PostgreSQL database.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<Type>>
A list of the types that were deleted, or null if the operation could not be performed.

Modify.RemoveAsync(NpgsqlConnection, IEnumerable<PartitionUniqueReference>, bool) Method

Removes the specified partition unique references from the database asynchronously.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.PostgreSQL.PartitionUniqueReference.Classes.PartitionUniqueReference>?> RemoveAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<DiGi.PostgreSQL.PartitionUniqueReference.Classes.PartitionUniqueReference> partitionUniqueReferences, bool clean=true);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The connection to the PostgreSQL database.

partitionUniqueReferences System.Collections.Generic.IEnumerable<PartitionUniqueReference>

The collection of partition unique references to be removed.

clean System.Boolean

A value indicating whether to perform cleanup of partitions and types after removal.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<PartitionUniqueReference>>
A HashSet of PartitionUniqueReference containing the successfully removed references, or null if the operation failed or no references were processed.

Modify.UpdateAsync<USerializableObject>(this NpgsqlConnection, IEnumerable<USerializableObject>, Func<string,DataType>, object, PartitionUniqueReferenceGeneratingEventHandler) Method

Asynchronously updates the partition unique references in the PostgreSQL database for a collection of serializable objects.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.PostgreSQL.PartitionUniqueReference.Classes.PartitionUniqueReference>?> UpdateAsync<USerializableObject>(this Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<USerializableObject> serializableObjects, System.Func<string?,DiGi.PostgreSQL.Enums.DataType> dataTypeFunc, object? sender=null, DiGi.PostgreSQL.PartitionUniqueReference.Delegates.PartitionUniqueReferenceGeneratingEventHandler? partitionUniqueReferenceGeneratingEventHandler=null)
    where USerializableObject : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

USerializableObject

The type of the serializable object, which must implement DiGi.Core.Interfaces.ISerializableObject.

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to communicate with the database.

serializableObjects System.Collections.Generic.IEnumerable<USerializableObject>

A collection of objects that are to be updated in the database.

dataTypeFunc System.Func<System.String,DiGi.PostgreSQL.Enums.DataType>

A function used to determine the DiGi.PostgreSQL.Enums.DataType based on a provided string key.

sender System.Object

The object that initiated the request; defaults to null.

partitionUniqueReferenceGeneratingEventHandler PartitionUniqueReferenceGeneratingEventHandler(object, PartitionUniqueReferenceGeneratingEventArgs)

An optional event handler for generating partition unique references; defaults to null.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<PartitionUniqueReference>>
A task representing the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of updated PartitionUniqueReference objects, or null if the connection is null, serializable objects are null, or critical table creation fails.

Modify.UpdateTypeIdAsync(this NpgsqlConnection, string) Method

Updates or creates a type ID based on the provided name.

public static System.Threading.Tasks.Task<DiGi.PostgreSQL.PartitionUniqueReference.Classes.Type?> UpdateTypeIdAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, string? name);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection instance used to perform the operation.

name System.String

The name of the type to update or create.

Returns

System.Threading.Tasks.Task<Type>
A task that represents the asynchronous operation, containing the updated or created Type object, or null if the operation failed or inputs were invalid.

Query Class

public static class Query

Inheritance System.Object → Query

Methods

Query.ContainsAsync(this NpgsqlConnection, Partition, IEnumerable<IUniqueReference>) Method

Checks for the existence of multiple unique references within a specific database partition.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Interfaces.IUniqueReference>?> ContainsAsync(this Npgsql.NpgsqlConnection npgsqlConnection, DiGi.PostgreSQL.Classes.Partition? partition, System.Collections.Generic.IEnumerable<DiGi.Core.Interfaces.IUniqueReference>? uniqueReferences);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection instance.

partition DiGi.PostgreSQL.Classes.Partition

The partition to search within.

uniqueReferences System.Collections.Generic.IEnumerable<DiGi.Core.Interfaces.IUniqueReference>

A collection of unique references to verify.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Interfaces.IUniqueReference>>
A task that represents the asynchronous operation, containing a set of existing unique references, or null if any input is null.

Query.ContainsAsync(this NpgsqlConnection, Type) Method

Checks whether a specific database type exists across all supported data type tables.

public static System.Threading.Tasks.Task<bool> ContainsAsync(this Npgsql.NpgsqlConnection npgsqlConnection, DiGi.PostgreSQL.PartitionUniqueReference.Classes.Type? type);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection instance.

type Type

The database type to check for existence.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation, containing true if the type is found; otherwise, false.

Query.ContainsAsync(this NpgsqlConnection, IEnumerable<PartitionUniqueReference>) Method

Checks for the existence of a collection of partition unique references within the database.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.PostgreSQL.PartitionUniqueReference.Classes.PartitionUniqueReference>?> ContainsAsync(this Npgsql.NpgsqlConnection npgsqlConnection, System.Collections.Generic.IEnumerable<DiGi.PostgreSQL.PartitionUniqueReference.Classes.PartitionUniqueReference> partitionUniqueReferences);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection instance.

partitionUniqueReferences System.Collections.Generic.IEnumerable<PartitionUniqueReference>

A collection of partition unique references to verify.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<PartitionUniqueReference>>
A task that represents the asynchronous operation, containing a set of existing partition unique references, or null if the input is invalid.

Query.ContainsAsync(this NpgsqlConnection, Type) Method

Checks whether a specific system type exists within the database.

public static System.Threading.Tasks.Task<bool> ContainsAsync(this Npgsql.NpgsqlConnection npgsqlConnection, System.Type? type);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection instance.

type System.Type

The system type to check for existence.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation, containing true if the type is found; otherwise, false.

Query.SerializableObjectsAsync<USerializableObject>(NpgsqlConnection, IEnumerable<PartitionUniqueReference>) Method

Asynchronously retrieves a list of serializable objects based on the provided PostgreSQL connection and partition unique references.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>?> SerializableObjectsAsync<USerializableObject>(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<DiGi.PostgreSQL.PartitionUniqueReference.Classes.PartitionUniqueReference> partitionUniqueReferences)
    where USerializableObject : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

USerializableObject

The type of serializable object to retrieve, which must implement ISerializableObject.

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection used to execute the query.

partitionUniqueReferences System.Collections.Generic.IEnumerable<PartitionUniqueReference>

A collection of partition unique references to filter the objects.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>>
A task that represents the asynchronous operation, containing a list of serializable objects if successful; otherwise, null.

Query.TypeAsync(this NpgsqlConnection, string) Method

Asynchronously retrieves a type from the database by its name.

public static System.Threading.Tasks.Task<DiGi.PostgreSQL.PartitionUniqueReference.Classes.Type?> TypeAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, string? name);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The connection to the PostgreSQL database.

name System.String

The name of the type to retrieve.

Returns

System.Threading.Tasks.Task<Type>
A Type instance if the type is found; otherwise, null.

Query.TypeIdAsync(this NpgsqlConnection, Type) Method

Asynchronously retrieves the unique identifier of a type from the database based on its full name.

public static System.Threading.Tasks.Task<System.Nullable<short>> TypeIdAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, System.Type? type);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection used to execute the query.

type System.Type

The system type for which the ID is being retrieved.

Returns

System.Threading.Tasks.Task<System.Nullable<System.Int16>>
A task that represents the asynchronous operation. The task result contains the type identifier as a short if found; otherwise, null.

Query.TypesAsync(this NpgsqlConnection, string) Method

Asynchronously retrieves a list of types from the database based on the provided type name.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.PartitionUniqueReference.Classes.Type>?> TypesAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, string? name);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection to use for the query.

name System.String

The name of the type to search for.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<Type>>
A task that represents the asynchronous operation. The task result contains a list of matching Type objects, or null if the connection is null or the name is invalid.

Query.TypesAsync(this NpgsqlConnection, IEnumerable<short>) Method

Asynchronously retrieves a list of types from the database filtered by a collection of type identifiers.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.PartitionUniqueReference.Classes.Type>?> TypesAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<short>? typeIds=null);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection to use for the query.

typeIds System.Collections.Generic.IEnumerable<System.Int16>

An optional collection of short integers representing the IDs of the types to retrieve.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<Type>>
A task that represents the asynchronous operation. The task result contains a list of matching Type objects, or null if the connection is null.

Query.TypesAsync(this NpgsqlConnection, Type) Method

Asynchronously retrieves a list of types from the database that are assignable from the specified type.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.PartitionUniqueReference.Classes.Type>?> TypesAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, System.Type? type);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection to use for the query.

type System.Type

The system type used to filter the retrieved types.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<Type>>
A task that represents the asynchronous operation. The task result contains a list of matching Type objects, or null if the connection or type is null.

Query.UniqueTypeIdsAsync(this NpgsqlConnection, Partition) Method

Retrieves all unique type IDs present in a specific partition from the database.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<short>?> UniqueTypeIdsAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.PostgreSQL.Classes.Partition? partition);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection used to execute the query.

partition DiGi.PostgreSQL.Classes.Partition

The partition for which to retrieve the unique type IDs.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int16>>
A System.Collections.Generic.HashSet<> containing the unique type IDs if successful; otherwise, null.

Clone this wiki locally