private static OperandType getOperandType(String opd) { Regex stringTypeRgx = new Regex(@"^'[^']*'$"); int num_tmp = 0; int dot_index = opd.IndexOf('.'); if (dot_index != -1 && dot_index != 0 && dot_index != opd.Length - 1) //attr with Table { return(OperandType.attr); } // if (stringTypeRgx.IsMatch(opd)) { return(OperandType.str); } else if (Int32.TryParse(opd, out num_tmp)) { return(OperandType.num); } else if (SqlGrammar.checkVariableNameValidOrThrowException(opd)) { return(OperandType.attr); } else { throw new DbException.InvalidKeyword("Wrong condition clause."); } }
/// <summary> /// Initializes a new instance of a SqlResponder. /// </summary> /// <param name="grammar">The grammar to use.</param> protected SqlGenerator(SqlGrammar grammar) { if (grammar == null) { grammar = SqlGrammar.Default; } this.grammar = grammar; }
/// <summary> /// Initializes a new instance of a SimpleFormatter. /// </summary> /// <param name="grammar">The grammar to use.</param> public CommandBuilder(SqlGrammar grammar = null) : base(grammar) { }