Example #1
0
        protected virtual void Extract(Match rx, OuterSelectMatch result)
        {
            result.InnerSql      = rx.Groups["InnerSql"].Value.Squeeze();
            result.AggregateType = rx.Groups?["AggregateType"]?.Value?.Squeeze() ?? "";

            result.InnerSelect = InnerSqlMatcher.Match(result.InnerSql);
        }
Example #2
0
        public OuterSelectMatch Match(string sqlQuery, string expectedOuterSql)
        {
            sqlQuery         = sqlQuery.Squeeze();
            expectedOuterSql = expectedOuterSql.Squeeze();
            var rx = Regex.Match(sqlQuery.Squeeze(), expectedOuterSql.Squeeze());

            OuterSelectMatch result = new OuterSelectMatch
            {
                Success = rx.Success
            };

            if (!rx.Success)
            {
                return(result);
            }

            Extract(rx, result);

            return(result);
        }