internal override SqlRow VisitRow(SqlRow row) { foreach(SqlColumn c in row.Columns) { this.Visit(c.Expression); } return row; }
internal override SqlRow VisitRow(SqlRow row) { foreach(SqlColumn col in row.Columns) { this.VisitColumn(col); } return row; }
internal bool HasRowNumber(SqlRow row) { foreach(SqlColumn column in row.Columns) { if(this.HasRowNumber(column)) { return true; } } return false; }
internal override SqlRow VisitRow(SqlRow row) { for(int i = 0, n = row.Columns.Count; i < n; i++) { row.Columns[i].Expression = this.VisitExpression(row.Columns[i].Expression); if(this.hasRowNumber) { this.CurrentColumn = row.Columns[i]; break; } } return row; }
internal override SqlRow VisitRow(SqlRow row) { for(int i = 0, n = row.Columns.Count; i < n; i++) { SqlColumn col = row.Columns[i]; SqlExpression expr = this.VisitExpression(col.Expression); if(expr != null) { if(TypeSystem.GetNonNullableType(col.ClrType) != TypeSystem.GetNonNullableType(expr.ClrType)) { throw Error.ColumnClrTypeDoesNotAgreeWithExpressionsClrType(); } } } return row; }
internal override SqlRow VisitRow(SqlRow row) { foreach(SqlColumn c in row.Columns) { if(this.RefersToColumn(c, this.match)) { if(this.found != null) { throw Error.ColumnIsDefinedInMultiplePlaces(GetColumnName(this.match)); } this.found = c; break; } } return row; }
internal SelectionFlattener(SqlRow row, Dictionary<SqlColumn, SqlColumn> map, bool isInput) { this.row = row; this.map = map; this.isInput = isInput; }
internal virtual SqlRow VisitRow(SqlRow row) { for (int i = 0, n = row.Columns.Count; i < n; i++) { row.Columns[i].Expression = this.VisitExpression(row.Columns[i].Expression); } return row; }
internal override SqlRow VisitRow(SqlRow row) { foreach (SqlColumn c in row.Columns) { c.Alias = alias; } return base.VisitRow(row); }
internal override SqlRow VisitRow(SqlRow row) { for(int i = 0, n = row.Columns.Count; i < n; i++) { SqlColumn c = row.Columns[i]; if(i > 0) _commandStringBuilder.Append(", "); this.Visit(c.Expression); string name = c.Name; string inferredName = this.InferName(c.Expression, null); if(name == null) name = inferredName; if(name == null) { if(!_names.TryGetValue(c, out name)) { name = "C" + _names.Count; _names[c] = name; } } if(name != inferredName && !String.IsNullOrEmpty(name)) { _commandStringBuilder.Append(" AS "); this.WriteName(name); } } return row; }
internal override SqlRow VisitRow(SqlRow row) { SqlRow nrow = new SqlRow(row.SourceExpression); foreach(SqlColumn c in row.Columns) { nrow.Columns.Add((SqlColumn)this.Visit(c)); } return nrow; }
private SqlExpression FlattenSelection(SqlRow row, bool isInput, SqlExpression selection) { selection = this.columnizer.ColumnizeSelection(selection); return new SelectionFlattener(row, this.map, isInput).VisitExpression(selection); }
private void ForceLocal(SqlRow row, string name) { bool isLocal = false; // check to see if it already exists locally foreach(SqlColumn c in row.Columns) { if(this.RefersToColumn(c, this.found)) { this.found = c; isLocal = true; break; } } if(!isLocal) { // need to put this in the local projection list to bubble it up SqlColumn c = new SqlColumn(found.ClrType, found.SqlType, name, this.found.MetaMember, new SqlColumnRef(this.found), row.SourceExpression); row.Columns.Add(c); this.found = c; } }