HAKOM.Persistence.Sql.Net Assembly
Provides the database-agnostic SQL persistence layer for HAKOM applications, defining the base abstractions and shared implementation for executing queries, reading typed column values, and managing parameterised SQL commands across all supported SQL database providers.
Remarks
Section titled “Remarks”This assembly contains the provider-independent base class
SqlStorageProvider<TConnection,TCommand,TNativeParameter,TReader,TParameter,TParameterFactory>
which implements the core lifecycle of opening connections, preparing commands,
executing queries, streaming results via System.Collections.Generic.IAsyncEnumerable<>, and
reading strongly-typed column values through a comprehensive set of
Read* methods (e.g. ReadInt, ReadString,
ReadDateTime).
Provider-specific assemblies (Oracle, PostgreSQL, SQL Server) derive from SqlStorageProvider<TConnection,TCommand,TNativeParameter,TReader,TParameter,TParameterFactory> and supply the concrete ADO.NET types for connections, commands, parameters, and data readers.
The assembly also defines:
- ISqlStorageProvider — The root interface for executing parameterless SQL statements.
- ISqlStorageProvider<TReader> — Adds typed
Select,SelectFirst, and column-reading methods. - ISqlStorageProvider<TParameter,TParameterFactory,TReader> — Extends the provider with parameterised query support and wildcard escaping.
- ISqlParameter — Marker interface for all SQL parameter types.
- ISqlParameterFactory<TParameter> — Factory for creating provider-specific parameters from name/value pairs.
All fallible operations follow the Try/Result pattern: the Try* methods return
Result<TValue> and never throw, while the
throwing wrappers delegate to
GetValueOrThrow().
| Namespaces | |
|---|---|
| HAKOM.Persistence.Sql.Net.Api | Contains the public API surface of the database-agnostic SQL persistence module, including storage provider interfaces, parameter abstractions, and base implementation classes. |
| HAKOM.Persistence.Sql.Net.Api.Exceptions | Contains exception types that are raised by the database-agnostic SQL persistence layer when connection, query, or column-reading operations fail. |
| HAKOM.Persistence.Sql.Net.Api.Versioning | Contains the SQL-specific base class for querying repository version information from the DBVERSION table in SQL databases. |