render method
Renders this clause to SQL text, recording any bind values on context.
context is the entire context a clause is given: use
RenderContext.escapeName for identifiers and RenderContext.param
for values.
Return an empty string to render nothing, which is how an optional clause
(such as a WHERE with no filter) drops itself from the statement.
Implementation
@override
String render(RenderContext context) {
if (table.derivedFrom case final Query<dynamic> query) {
final inner = QueryClause(query).render(context);
return '($inner) AS ${context.escapeName(table.aliasOrName)}';
}
return [
context.escapeName(table.name),
if (table.alias case final String alias)
'AS ${context.escapeName(alias)}',
].join(' ');
}