Table of Contents

TAureliusConnection Class

Non-visual design-time component that configures and provides database connections for the Aurelius ORM framework.

Remarks

TAureliusConnection is the primary RAD way to set up a database connection. It supports two modes:

Adapter mode: wraps an existing third-party data-access component (such as a FireDAC TFDConnection or dbExpress TSQLConnection) and adapts it to the IDBConnection interface used by Aurelius. Set AdaptedConnection, AdapterName, and SQLDialect to use this mode.

Driver mode: connects directly to the database using an Aurelius native driver, without requiring any third-party component. Set DriverName and populate Params to use this mode.

The component also acts as a singleton connection pool: it creates a single IDBConnection instance internally and reuses it for all object manager instances that reference this component via TAureliusManager.Connection. To create an independent new connection, use CreateConnection.

Syntax

Unit: Aurelius.Comp.Connection

TAureliusConnection = class(TAureliusCustomConnectionPool, IDBConnectionPool);

Constructors

Name Description
Create Creates a new TAureliusConnection instance owned by AOwner.

Methods

Name Description
CreateConnection Creates and returns a new IDBConnection interface configured according to the current adapter or driver settings.
CreateConnection​Factory Creates and returns an IDBConnectionFactory that produces new IDBConnection instances using the current connection settings.
GetPoolInterface Returns the IDBConnectionPool interface implemented by this component (returns Self).

Properties

Name Description
AdaptedConnection Gets or sets the third-party data-access component that is adapted to provide an IDBConnection interface in adapter mode.
AdapterName Gets or sets the name of the component adapter used to connect to the database in adapter mode (e.g., 'FireDac', 'dbExpress', 'dbGo').
CloningMode Gets or sets the strategy used to clone the adapted connection component when CreateConnection is called in adapter mode.
DriverName Gets or sets the name of the native database driver used to connect to the database in driver mode (e.g., 'MSSQL', 'SQLite').
Params Gets or sets the connection parameters used by the native driver in driver mode.
SQLDialect Gets or sets the SQL dialect used when generating SQL statements for the target database (e.g., 'PostgreSQL', 'MSSQL', 'Firebird').