Example #1
0
        internal SqlString[] SplitWithRegex(string pattern)
        {
            var sql = Regex.Split(ToString(), pattern).Select(s => SqlString.Parse(s)).ToArray();
            int i   = 0;

            foreach (var p in sql.SelectMany(s => s.GetParameters()))
            {
                p.BackTrack = GetParameters().ElementAt(i).BackTrack;
                i++;
            }
            return(sql);
        }
Example #2
0
        /// <summary>
        /// This method is a bit of a hack, and assumes
        /// that the column on the "right" side of the
        /// join appears on the "left" side of the
        /// operator, which is extremely weird if this
        /// was a normal join condition, but is natural
        /// for a filter.
        /// </summary>
        private void AddLeftOuterJoinCondition(SqlString on)
        {
            StringBuilder buf = new StringBuilder(on.ToString());

            for (int i = 0; i < buf.Length; i++)
            {
                char character     = buf[i];
                bool isInsertPoint = Operators.Contains(character) ||
                                     (character == ' ' && buf.Length > i + 3 && "is ".Equals(buf.ToString(i + 1, 3)));
                if (isInsertPoint)
                {
                    buf.Insert(i, "(+)");
                    i += 3;
                }
            }
            AddCondition(SqlString.Parse(buf.ToString()));
        }
Example #3
0
 internal SqlString[] SplitWithRegex(string pattern)
 {
     return(Regex.Split(ToString(), pattern).Select(s => SqlString.Parse(s)).ToArray());
 }