public static FindEqualityJoinVisitor Run(string sql)
        {
            var aliasFinder = new AliasResolutionVisitor();

            RunTSqlFragmentVisitor.AnalyzeFragmentVisitor(sql, sql.ComputeHash(), aliasFinder);

            var visitor = new FindEqualityJoinVisitor(aliasFinder.Aliases);

            RunTSqlFragmentVisitor.AnalyzeFragmentVisitorBase(sql, sql.ComputeHash(), visitor);
            return(visitor);
        }
示例#2
0
        private static void runAnalysis(Command command)
        {
            CommandStatistics result;

            if (_commandStatistics.TryGetValue(command.SqlHash, out result))
            {
                command.CommandStatistics = result;
            }
            else
            {
                var counterVisitor = new CounterVisitor();
                RunTSqlFragmentVisitor.AnalyzeFragmentVisitor(command.Sql, command.SqlHash, counterVisitor);

                command.CommandStatistics = counterVisitor.CommandStatistics;
                _commandStatistics.Add(command.SqlHash, counterVisitor.CommandStatistics);
            }
        }
        private static void setNormalizedSqlHash(Command item)
        {
            var result = RunTSqlFragmentVisitor.GetNormalizedSqlHash(item.Sql, item.SqlHash);

            item.NormalizedSqlHash = result.NormalizedSqlHash;
        }