Table of Contents

ISQLGenerator Interface

Translates Aurelius SQL command objects into database-specific SQL strings and provides metadata about the capabilities and type system of the target database engine.

Remarks

Each database driver registers a concrete implementation of ISQLGenerator that handles the dialect differences between engines (quoting, paging, DDL syntax, type mapping, sequence support, etc.). Aurelius selects the correct generator based on the connection's SqlDialect string.

Syntax

Unit: Aurelius.Sql.Interfaces

ISQLGenerator = interface(IInterface);

Methods

Name Description
ConvertValue Converts a value from one field type representation to another, handling any data transformation required by the target engine.
DefineColumnType Resolves and sets the database-specific DataType string on the column descriptor, applying any necessary field-type substitutions for the target engine.
FindSQLFunction Looks up a custom SQL function registered under the given name.
GenerateCreateColumn Generates the DDL statement that adds a new column to an existing table.
GenerateCreate​DBIndex Generates the DDL statement that creates a non-unique database index on a table.
GenerateCreate​ForeignKey Generates the DDL statement that adds a foreign key constraint to an existing table.
GenerateCreate​Sequence Generates the DDL statement that creates a named database sequence.
GenerateCreateTable Generates the DDL statement that creates a database table, optionally including its foreign key constraints.
GenerateCreate​UniqueKey Generates the DDL statement that adds a unique constraint to a table.
GenerateDelete Generates a DELETE SQL statement from the given command descriptor.
GenerateDropDBIndex Generates the DDL statement that drops a non-unique database index.
GenerateDropField Generates the DDL statement that removes an existing column from a table.
GenerateDrop​ForeignKey Generates the DDL statement that removes a foreign key constraint from a table.
GenerateDropSequence Generates the DDL statement that drops a named database sequence.
GenerateDropTable Generates the DDL statement that drops an existing database table.
GenerateDrop​UniqueKey Generates the DDL statement that removes a unique key constraint from a table.
GenerateEnable​Foreign​Keys Generates a SQL statement that enables or disables all foreign key constraint checks in the database.
GenerateGetLast​InsertId Generates the SQL expression or statement used to retrieve the auto-generated primary key produced by the most recent INSERT.
GenerateGetNext​Sequence​Value Generates a SQL statement that retrieves the next value from a database sequence.
GenerateInsert Generates an INSERT SQL statement from the given command descriptor.
GenerateSelect Generates a SELECT SQL statement from the given command descriptor.
GenerateUpdate Generates an UPDATE SQL statement from the given command descriptor.
GetDefaultColumnName Returns the default column alias for the given select field, used when the generated SQL needs an explicit column label.
GetDefaultParamName Returns the default parameter placeholder name for the given SQL field, following the naming conventions of the target dialect.
GetEquivalent​Field​Types Gets the array of field-type substitutions that must be applied for unsupported types on the target engine.
GetForeignKeyName Returns the constraint name to use for the given foreign key in the generated DDL.
GetFullTableName Returns the fully qualified table name, combining the table name and optional schema according to the target dialect's quoting and separator rules.
GetGeneratorName Gets the unique name that identifies this SQL generator implementation.
GetOptimalGuidMode Returns the TSequentialGuidMode that produces the best-performing sequential GUID index keys for the target database engine.
GetQualified​Column​Name Returns the fully qualified, dialect-specific column reference for the given select field (e.g., t0."Name").
GetSqlDialect Gets the SQL dialect string that maps this generator to a compatible database connection.
GetSqlLiteral Converts a Delphi variant value to its SQL literal representation for the given field type.
GetSupportedFeatures Gets the set of optional database features supported by this generator's target engine.
GetSupported​Field​Types Gets the set of TFieldType values that are natively supported by the target database engine.
GetUniqueKeyName Returns the constraint name to use for the given unique key in the generated DDL.
GetWhereCondition Builds the SQL WHERE predicate fragment that compares two operands using the specified operator.
ProcessCommand Applies any final, dialect-specific transformations to a SQL string immediately before the statement is sent to the database driver for execution.
RegisterFunction Registers a custom SQL function under the given name so it can be used in Aurelius LINQ expressions targeting this generator.

Properties

Name Description
EquivalentFieldTypes Gets the array of field-type substitutions that must be applied for unsupported types on the target engine.
GeneratorName Gets the unique name that identifies this SQL generator implementation.
SqlDialect Gets the SQL dialect string that maps this generator to a compatible database connection.
SupportedFeatures Gets the set of optional database features supported by this generator's target engine.
SupportedFieldTypes Gets the set of TFieldType values that are natively supported by the target database engine.