Repository navigation
DiGi.PostgreSQL.PartitionUniqueReference
public static class ModifyInheritance System.Object → Modify
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);npgsqlConnection Npgsql.NpgsqlConnection
The connection to the PostgreSQL database.
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.
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);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.
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;USerializableObject
The type of the serializable object, which must implement DiGi.Core.Interfaces.ISerializableObject.
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.
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.
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);npgsqlConnection Npgsql.NpgsqlConnection
The PostgreSQL connection instance used to perform the operation.
name System.String
The name of the type to update or create.
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.
public static class QueryInheritance System.Object → Query
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);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.
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.
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);npgsqlConnection Npgsql.NpgsqlConnection
The PostgreSQL connection instance.
type Type
The database type to check for existence.
System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation, containing true if the type is found; otherwise, false.
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);npgsqlConnection Npgsql.NpgsqlConnection
The PostgreSQL connection instance.
partitionUniqueReferences System.Collections.Generic.IEnumerable<PartitionUniqueReference>
A collection of partition unique references to verify.
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.
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);npgsqlConnection Npgsql.NpgsqlConnection
The PostgreSQL connection instance.
type System.Type
The system type to check for existence.
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;USerializableObject
The type of serializable object to retrieve, which must implement ISerializableObject.
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.
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.
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);npgsqlConnection Npgsql.NpgsqlConnection
The connection to the PostgreSQL database.
name System.String
The name of the type to retrieve.
System.Threading.Tasks.Task<Type>
A Type instance if the type is found; otherwise, null.
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);npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection used to execute the query.
type System.Type
The system type for which the ID is being retrieved.
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.
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);npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection to use for the query.
name System.String
The name of the type to search for.
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.
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);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.
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.
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);npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection to use for the query.
type System.Type
The system type used to filter the retrieved types.
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.
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);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.
System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int16>>
A System.Collections.Generic.HashSet<> containing the unique type IDs if successful; otherwise, null.