Table of Contents

TAureliusDBSchema Class

Non-visual design-time component that validates and updates a database schema to match the current Aurelius ORM mapping model.

Remarks

TAureliusDBSchema wraps a TDatabaseManager and exposes its schema-management operations as component properties and methods, making them accessible at design time and from application code without writing boilerplate. Assign a Aurelius.Comp.Connection.TAureliusConnection (or any TAureliusCustomConnectionPool descendant) to Connection and optionally set ModelNames to restrict which mapping models are examined. Then call BuildDatabase, UpdateDatabase, ValidateDatabase, or DestroyDatabase to manage the schema. After each operation, inspect Actions, Warnings, and Errors for a detailed report of the changes applied or issues found.

Syntax

Unit: Aurelius.Comp.DBSchema

TAureliusDBSchema = class(TComponent);

Methods

Name Description
BuildDatabase Creates the database schema from scratch based on the current mapping model.
DestroyDatabase Drops all tables, sequences, and other schema objects defined in the mapping model.
ReleaseDBManager Releases the internal TDatabaseManager instance so that the next schema operation recreates it with fresh state.
UpdateDatabase Validates the database schema and executes the DDL statements needed to bring it in line with the mapping model.
ValidateDatabase Compares the current database schema against the mapping model and records any differences as actions, warnings, or errors.

Properties

Name Description
ActionCount Gets the number of actions recorded by the last schema operation.
Actions Gets the collection of informational actions recorded by the last schema operation.
Connection Gets or sets the connection pool component used to obtain a database connection for schema operations.
DBManager Gets the underlying TDatabaseManager instance used by this component.
ErrorCount Gets the number of errors recorded by the last schema operation.
Errors Gets the collection of errors recorded by the last schema operation.
ModelNames Gets or sets a comma-separated list of mapping model names to include in schema operations.
SQLStatements Gets the SQL DDL statements that were generated by the last schema operation.
WarningCount Gets the number of warnings recorded by the last schema operation.
Warnings Gets the collection of warnings recorded by the last schema operation.