Repository navigation
DiGi.PostgreSQL.UniqueReference
public static class ConvertInheritance System.Object → Convert
Convert.ToDiGi<TSerializableObject,TUniqueReference>(this ConnectionData, IEnumerable<TUniqueReference>) Method
Converts the database objects with the specified unique references to a list of serializable objects of type TSerializableObject.
public static System.Threading.Tasks.Task<System.Collections.Generic.List<TSerializableObject>?> ToDiGi<TSerializableObject,TUniqueReference>(this DiGi.PostgreSQL.Classes.ConnectionData connectionData, System.Collections.Generic.IEnumerable<TUniqueReference> uniqueReferences)
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject
where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;TSerializableObject
The type of serializable object to convert to.
TUniqueReference
The type of unique reference.
connectionData DiGi.PostgreSQL.Classes.ConnectionData
The connection data used to connect to the database.
uniqueReferences System.Collections.Generic.IEnumerable<TUniqueReference>
The collection of unique references to filter by.
System.Threading.Tasks.Task<System.Collections.Generic.List<TSerializableObject>>
A task representing the asynchronous operation, returning the list of serializable objects or null.
Converts the database objects to a list of serializable objects of type TSerializableObject.
public static System.Threading.Tasks.Task<System.Collections.Generic.List<TSerializableObject>?> ToDiGi<TSerializableObject>(this DiGi.PostgreSQL.Classes.ConnectionData connectionData, bool inheritance=true)
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;TSerializableObject
The type of serializable object to convert to.
connectionData DiGi.PostgreSQL.Classes.ConnectionData
The connection data used to connect to the database.
inheritance System.Boolean
A value indicating whether to include inherited types.
System.Threading.Tasks.Task<System.Collections.Generic.List<TSerializableObject>>
A task representing the asynchronous operation, returning the list of serializable objects or null.
Converts a serializable object to its PostgreSQL unique reference representation.
public static System.Threading.Tasks.Task<DiGi.Core.Classes.UniqueReference?> ToPostgreSQL(this DiGi.Core.Interfaces.ISerializableObject? serializableObject, DiGi.PostgreSQL.Classes.ConnectionData connectionData);serializableObject DiGi.Core.Interfaces.ISerializableObject
The serializable object to convert.
connectionData DiGi.PostgreSQL.Classes.ConnectionData
The connection data for the PostgreSQL database.
System.Threading.Tasks.Task<DiGi.Core.Classes.UniqueReference>
A task that represents the asynchronous operation, containing the converted unique reference or null if the input object is null.
Convert.ToPostgreSQL<TSerializableObject>(this IEnumerable<TSerializableObject>, ConnectionData) Method
Converts a collection of serializable objects to their PostgreSQL unique reference representations.
public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Classes.UniqueReference>?> ToPostgreSQL<TSerializableObject>(this System.Collections.Generic.IEnumerable<TSerializableObject>? serializableObjects, DiGi.PostgreSQL.Classes.ConnectionData? connectionData)
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;TSerializableObject
The type of the serializable objects, which must implement ISerializableObject.
serializableObjects System.Collections.Generic.IEnumerable<TSerializableObject>
The collection of serializable objects to convert.
connectionData DiGi.PostgreSQL.Classes.ConnectionData
The connection data for the PostgreSQL database.
System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Classes.UniqueReference>>
A task that represents the asynchronous operation, containing a hash set of converted unique references or null if inputs are null.
public static class ModifyInheritance System.Object → Modify
Removes all unique references associated with a specific type from the database asynchronously.
public static System.Threading.Tasks.Task<bool> RemoveAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Type type, bool inheritance=true);npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection to be used for the operation.
type System.Type
The type whose references should be removed.
inheritance System.Boolean
A value indicating whether to include inherited types in the removal process.
System.Threading.Tasks.Task<System.Boolean>
True if the removal was successful; otherwise, false.
Removes a collection of unique references from the database asynchronously.
public static System.Threading.Tasks.Task<System.Collections.Generic.List<TUniqueReference>?> RemoveAsync<TUniqueReference>(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<TUniqueReference> uniqueReferences, bool clean=true)
where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;TUniqueReference
The type of the unique reference, which must implement IUniqueReference.
npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection to be used for the operation.
uniqueReferences System.Collections.Generic.IEnumerable<TUniqueReference>
The collection of unique references to remove.
clean System.Boolean
A value indicating whether to clean partitions after the removal process.
System.Threading.Tasks.Task<System.Collections.Generic.List<TUniqueReference>>
A list of successfully removed unique references, or null if the connection is null or no valid references were found.
Modify.UpdateAsync<USerializableObject>(this NpgsqlConnection, IEnumerable<USerializableObject>, Func<Type,DataType>, object, UniqueIdReferenceGeneratingEventHandler) Method
Asynchronously updates or inserts serializable objects into the PostgreSQL database, utilizing partitioning and unique references via a batch operation.
public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Classes.UniqueReference>?> UpdateAsync<USerializableObject>(this Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<USerializableObject> serializableObjects, System.Func<System.Type?,DiGi.PostgreSQL.Enums.DataType> dataTypeFunc, object? sender=null, DiGi.PostgreSQL.UniqueReference.Delegates.UniqueIdReferenceGeneratingEventHandler? uniqueIdReferenceGeneratingEventHandler=null)
where USerializableObject : DiGi.Core.Interfaces.ISerializableObject;USerializableObject
The type of object that implements DiGi.Core.Interfaces.ISerializableObject.
npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.
serializableObjects System.Collections.Generic.IEnumerable<USerializableObject>
An System.Collections.Generic.IEnumerable<> containing the objects to be updated or inserted.
dataTypeFunc System.Func<System.Type,DiGi.PostgreSQL.Enums.DataType>
A delegate that maps a System.Type to a DiGi.PostgreSQL.Enums.DataType.
sender System.Object
The source of the event, used when invoking the unique ID reference generating event handler.
uniqueIdReferenceGeneratingEventHandler UniqueIdReferenceGeneratingEventHandler(object, UniqueIdReferenceGeneratingEventArgs)
An optional UniqueIdReferenceGeneratingEventHandler(object, UniqueIdReferenceGeneratingEventArgs) to customize the generation of unique references.
System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Classes.UniqueReference>>
A task that represents the asynchronous operation. The task result contains a HashSet of UniqueReference of updated references, or null if the connection or objects are null or an error occurs during table creation.
public static class QueryInheritance System.Object → Query
Checks whether the specified type exists in the database.
public static System.Threading.Tasks.Task<bool> ContainsAsync(this Npgsql.NpgsqlConnection npgsqlConnection, System.Type? type);npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection to use for the query.
type System.Type
The type to check for existence.
System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation, containing true if the type exists; otherwise, false.
Checks whether the specified unique references exist in the database.
public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<TUniqueReference>?> ContainsAsync<TUniqueReference>(this Npgsql.NpgsqlConnection npgsqlConnection, System.Collections.Generic.IEnumerable<TUniqueReference>? uniqueReferences)
where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;TUniqueReference
The type of the unique reference, which must implement DiGi.Core.Interfaces.IUniqueReference.
npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection to use for the query.
uniqueReferences System.Collections.Generic.IEnumerable<TUniqueReference>
A collection of unique references to check for existence.
System.Threading.Tasks.Task<System.Collections.Generic.HashSet<TUniqueReference>>
A hash set containing the unique references that were found in the database, or null if the connection or input collection is null.
Asynchronously counts the number of records for a specified type in the database.
public static System.Threading.Tasks.Task<long> CountAsync(this Npgsql.NpgsqlConnection npgsqlConnection, System.Type? type, bool inheritance=true);npgsqlConnection Npgsql.NpgsqlConnection
The PostgreSQL connection instance used to execute the query.
type System.Type
The type of the objects to count.
inheritance System.Boolean
A value indicating whether to include inherited types in the count.
System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total record count, or -1 if the connection or type is null.
Asynchronously retrieves the partition identifier for a given type using the provided PostgreSQL connection.
public static System.Threading.Tasks.Task<System.Nullable<short>> PartitionIdAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, System.Type? type);npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection to use for the query.
type System.Type
The type for which the partition ID is being retrieved.
System.Threading.Tasks.Task<System.Nullable<System.Int16>>
A task that represents the asynchronous operation. The task result contains the partition identifier as a short, or null if not found or inputs are invalid.
Asynchronously retrieves a list of partitions associated with the specified type name.
public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.Classes.Partition>?> PartitionsAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, string? name);npgsqlConnection Npgsql.NpgsqlConnection
The PostgreSQL connection to use for the query.
name System.String
The name of the type used to filter the partitions.
System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.Classes.Partition>>
A task that represents the asynchronous operation. The task result contains a list of DiGi.PostgreSQL.Classes.Partition objects, or null if the connection is null or the name is invalid.
Asynchronously retrieves a list of partitions that are assignable from the specified type.
public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.Classes.Partition>?> PartitionsAsync(this Npgsql.NpgsqlConnection? npgsqlConnection, System.Type? type);npgsqlConnection Npgsql.NpgsqlConnection
The PostgreSQL connection to use for the query.
type System.Type
The system type used to filter the partitions.
System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.PostgreSQL.Classes.Partition>>
A task that represents the asynchronous operation. The task result contains a list of DiGi.PostgreSQL.Classes.Partition objects, or null if the connection or type is null.
Query.SerializableObjectsAsync<USerializableObject,TUniqueReference>(NpgsqlConnection, IEnumerable<TUniqueReference>) Method
Asynchronously retrieves a list of serializable objects from the database using a collection of unique references.
public static System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>?> SerializableObjectsAsync<USerializableObject,TUniqueReference>(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<TUniqueReference> uniqueReferences)
where USerializableObject : DiGi.Core.Interfaces.ISerializableObject
where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;USerializableObject
The type of serializable object to retrieve, which must implement DiGi.Core.Interfaces.ISerializableObject.
TUniqueReference
The type of the unique reference used for lookup, which must implement DiGi.Core.Interfaces.IUniqueReference.
npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection used to execute the database query.
uniqueReferences System.Collections.Generic.IEnumerable<TUniqueReference>
A collection of unique references to be resolved into serializable objects.
System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>>
A task that represents the asynchronous operation. The task result contains a list of retrieved serializable objects, or null if the connection or unique references are null.
Asynchronously retrieves a list of serializable objects from the database based on the specified type and inheritance settings.
public static System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>?> SerializableObjectsAsync<USerializableObject>(Npgsql.NpgsqlConnection? npgsqlConnection, bool inheritance=true)
where USerializableObject : DiGi.Core.Interfaces.ISerializableObject;USerializableObject
The type of serializable object to retrieve, which must implement DiGi.Core.Interfaces.ISerializableObject.
npgsqlConnection Npgsql.NpgsqlConnection
The Npgsql connection used to execute the database query.
inheritance System.Boolean
A value indicating whether to include inherited types in the retrieval process.
System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>>
A task that represents the asynchronous operation. The task result contains a list of retrieved serializable objects, or null if the connection is null.