toSQL<T extends SqlType> method
Generates the SQL for this field with optional alias.
Returns the field name (properly quoted) with "AS alias" if an alias is provided.
Example:
QSelect('name').toSQL(); // "`name`"
QSelect('email', as: 'user_email').toSQL(); // "`email` AS `user_email`"
Implementation
@override
String toSQL<T extends SqlType>() {
return as.isNotEmpty
? '${QField(field).toSQL<T>()} AS ${QField(as).toSQL<T>()}'
: QField(field).toSQL<T>();
}