Skip to content

DiGi.PostgreSQL.PartitionReference

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

DiGi.PostgreSQL.PartitionReference Namespace

Classes

Modify Class

public static class Modify

Inheritance System.Object → Modify

Methods

Modify.RemoveAsync(NpgsqlConnection, IEnumerable<PartitionReference>) Method

Asynchronously removes the specified partition references from the database.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.PostgreSQL.PartitionReference.Classes.PartitionReference>?> RemoveAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<DiGi.PostgreSQL.PartitionReference.Classes.PartitionReference> partitionReferences);

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection to be used for the operation.

partitionReferences System.Collections.Generic.IEnumerable<PartitionReference>

The collection of partition references to remove.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<PartitionReference>>
A hash set containing the successfully removed partition references, or null if the connection is null or an error occurred during processing.

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

Asynchronously updates the specified serializable objects in the PostgreSQL database, utilizing partitions and UPSERT logic.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.PostgreSQL.PartitionReference.Classes.PartitionReference>?> 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.PartitionReference.Delegates.PartitionReferenceGeneratingEventHandler? partitionReferenceGeneratingEventHandler=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 connection to be used for the database operation.

serializableObjects System.Collections.Generic.IEnumerable<USerializableObject>

The collection of objects to be updated.

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

A function that determines the DiGi.PostgreSQL.Enums.DataType based on the partition name.

sender System.Object

The object that sends the event, passed to the partitionReferenceGeneratingEventHandler.

partitionReferenceGeneratingEventHandler PartitionReferenceGeneratingEventHandler(object, PartitionReferenceGeneratingEventArgs)

An optional event handler for generating partition references.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<PartitionReference>>
A task that represents the asynchronous operation. The task result contains a HashSet of PartitionReference of updated partition references, or null if the connection or objects are null or if the table creation fails.

Query Class

public static class Query

Inheritance System.Object → Query

Methods

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

Asynchronously checks if the specified partition references exist in the database.

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

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection to be used for the operation.

partitionReferences System.Collections.Generic.IEnumerable<PartitionReference>

The collection of partition references to check for existence.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<PartitionReference>>
A task that represents the asynchronous operation. The task result contains a HashSet of the partition references that exist in the database, or null if the connection or the input collection is null.

Query.SerializableObjectsAsync<USerializableObject>(NpgsqlConnection, string) Method

Asynchronously retrieves a list of serializable objects associated with a specific partition name.

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

Type parameters

USerializableObject

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

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection to use for the database query.

name System.String

The name of the partition from which to retrieve objects.

Returns

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

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

Asynchronously retrieves a list of serializable objects associated with a collection of partition references.

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

Type parameters

USerializableObject

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

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql connection to use for the database query.

partitionReferences System.Collections.Generic.IEnumerable<PartitionReference>

A collection of partition references used to identify the objects to retrieve.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>>
A task that represents the asynchronous operation, containing a list of serializable objects or null if the connection or partition references are null.

Clone this wiki locally