コード例 #1
0
ファイル: SQLBaseInterpreter.cs プロジェクト: IM-SQL/IMSQL
        //TODO: maybe move this to a subclass
        protected virtual RecordTable ApplyOutputClause(RecordTable source, OutputClause clause)
        {
            var selectors = Visit <Func <Environment, Func <IResultTable, Selector[]> > >(clause)?.Invoke(Database.GlobalEnvironment)(source);

            if (selectors != null)
            {
                return(new RecordTable(source.TableName, selectors, Filter.From(source.Records, (row) => true, null)));
            }
            return(null);
        }
コード例 #2
0
ファイル: SQLBaseInterpreter.cs プロジェクト: IM-SQL/IMSQL
 protected override object InternalVisit(OutputClause node)
 {
     return(new Func <Environment, Func <IResultTable, Selector[]> >(
                (env) =>
     {
         return new Func <IResultTable, Selector[]>((table) =>
         {
             return node.SelectColumns.SelectMany(
                 (element) =>
             {
                 return EvaluateExpression <Func <IResultTable, Selector[]> >(element, env)(table);
             }).ToArray();
         });
     }));
 }
コード例 #3
0
ファイル: AllNodesVisitor.cs プロジェクト: yaakoviyun/sqlskim
 public override void Visit(OutputClause node) { this.action(node); }
コード例 #4
0
 public override void ExplicitVisit(OutputClause fragment)
 {
     _fragments.Add(fragment);
 }