Energy Source Standard

This document describes standard behavior for the Energy.Source database layer.

Connection

Connection

  • Wraps an ADO.NET connection of type T.

  • Thread-safe.

  • Supports cloning and persistent connections.

  • Provides Test(), Scalar<T>(), Execute(), and Query() operations.

Configuration

Configuration

  • ConnectionString is built from properties based on Dialect.

  • SQL Server and MySQL connection strings are fully implemented.

  • Other dialects provide a GetDSNPrefix() value.

Error handling

Error.Catch

  • Classifies database exceptions by error number.

  • Returns Error.Result with flags for retryable errors (timeout, deadlock, damaged connection) and final errors (syntax, missing object).

Structure

Structure.Table

  • A table has a Name, Schema, Identity, and collections of Columns, Indexes, and Rows.

  • Columns.GetPrimary() returns the first primary key column.