public void Append(string connector, string sqlformat, params object[] args) { if (_first) { _first = false; _commandTexts.Add(_firstConnector); } else { _commandTexts.Add(connector); } if (args == null || args.Length == 0) { _commandTexts.Add(sqlformat); _commandTextsLimit += 2; return; } var r = (FQLResult)FQL.Format(_provider, _argumentStart, sqlformat, args); _argumentStart += args.Length; _commandTexts.Add(r.CommandText); _commandTextsLimit += 2; _parameters.AddRange(r.DbParameters); _parametersLimit += r.DbParameters.Length; if (r._callback != null) { _callback += r._callback; } }
public void HavingOr(string sql, params object[] args) { if (_having == null) { _having = FQL.CreateBuilder(_fql, "HAVING"); } _having.Or(sql, args); }
public void GroupBy(string sql, params object[] args) { if (_group == null) { _group = FQL.CreateBuilder(_fql, "GROUP BY"); } _group.Concat(sql, args); }
public void OrderBy(string sql, params object[] args) { if (_order == null) { _order = FQL.CreateBuilder(_fql, "ORDER BY"); } _order.Concat(sql, args); }
public SqlBuilder(DbTour tour, string sql, object[] args) : base(GetDbHelper(tour)) { Assertor.AreNull(sql, "sql"); if (args == null && sql.Length < 24 && sql.IndexOfAny(new char[] { ' ', '\r', '\n', '\t' }) == -1) { sql = "SELECT * FROM " + sql; } _fql = tour._FQLProvider; _where = FQL.Format(_fql, sql, args).AsBuilder("WHERE"); }
/// <summary> 设置sql语句和参数,得到执行器 /// </summary> /// <param name="commandText">sql语句</param> /// <param name="args">参数</param> public DbExecuter Sql(string commandText, params object[] args) { var fql = FQL.Format(_FQLProvider, commandText, args); return(new DbExecuter(_DBHelper, CommandType.Text, fql.CommandText, fql.DbParameters, fql.ImportOutParameter)); }