You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now columns have a queryAlias, but the toString method doesn't use the alias:
/// Abstract class representing a database [Column]. Subclassed by the different/// supported column types such as [ColumnInt] or [ColumnString].abstractclassColumn<T> {
/// Corresponding dart [Type].finalType type;
finalString _columnName;
/// Name of the [Column].Stringget columnName => _columnName;
/// Table that column belongs to.finalTable table;
/// Query alias for the [Column].Stringget queryAlias =>'${table.queryPrefix}.$_columnName';
/// Creates a new [Column], this is typically done in generated code only.Column(
this._columnName,
this.table,
) : type =T;
@overrideStringtoString() {
return'"${table.queryPrefix}"."$_columnName"';
}
}
Expression.toString just calls Column.toString:
/// Database expression for a column.abstractclassColumnExpression<T> extendsExpression {
// ...Stringget _getColumnName {
if (column is!ColumnCount) {
return column.toString();
}
// ...
}
abstractclass_TwoPartColumnExpression<T> extendsColumnExpression<T> {
Expression other;
_TwoPartColumnExpression(super.column, this.other);
@overrideList<Column> get columns => [...super.columns, ...other.columns];
@overrideStringtoString() {
return'$_getColumnName$operator$other';
}
}
The problem with this is that for custom joins, I can't use Expression.toString to specify where clauses if the columns are aliased.
Really all columns should always be aliased (except for the outermost table)... so it would be nice to have a .toStringWithQueryAlias in both expressions and columns, which builds the same expression, but with the query alias "tableName.columnName", not the "tableName"."columnName" naming.
The text was updated successfully, but these errors were encountered:
Right now columns have a
queryAlias
, but thetoString
method doesn't use the alias:Expression.toString
just callsColumn.toString
:The problem with this is that for custom joins, I can't use
Expression.toString
to specifywhere
clauses if the columns are aliased.Really all columns should always be aliased (except for the outermost table)... so it would be nice to have a
.toStringWithQueryAlias
in both expressions and columns, which builds the same expression, but with the query alias"tableName.columnName"
, not the"tableName"."columnName"
naming.The text was updated successfully, but these errors were encountered: