static string GetUpdateSql(AnyDbConnection cnn, Update query) { ISqlOmRenderer renderer = Qb.CreateRenderer(cnn.DatabaseProvider); string sql = renderer.RenderUpdate(query); return(sql); }
static string GetInsertSelectSql(AnyDbConnection cnn, InsertSelect query) { ISqlOmRenderer renderer = Qb.CreateRenderer(cnn.DatabaseProvider); string sql = renderer.RenderInsertSelect(query); return(sql); }
public object ExecuteScalar(Select query) { ISqlOmRenderer render = Qb.CreateRenderer(_anyConnection.DatabaseProvider); _dbCommand.CommandText = render.RenderSelect(query); _dbCommand.CommandType = CommandType.Text; FillParameters(_dbCommand, query.Query.CommandParams, render); return(ExecuteScalar()); }
public int ExecuteNonQuery(Update query) { ISqlOmRenderer render = Qb.CreateRenderer(_anyConnection.DatabaseProvider); _dbCommand.CommandText = render.RenderUpdate(query); _dbCommand.CommandType = CommandType.Text; FillParameters(_dbCommand, query.Query.CommandParams, render); return(ExecuteNonQuery()); }
public DbDataReader ExecuteReader(Select query, CommandBehavior behavior) { ISqlOmRenderer render = Qb.CreateRenderer(_anyConnection.DatabaseProvider); _dbCommand.CommandText = render.RenderSelect(query); _dbCommand.CommandType = CommandType.Text; FillParameters(_dbCommand, query.Query.CommandParams, render); return(ExecuteReader(behavior)); }
public long ExecuteNonQuery(Insert query) { ISqlOmRenderer render = Qb.CreateRenderer(_anyConnection.DatabaseProvider); _dbCommand.CommandText = render.RenderInsert(query); _dbCommand.CommandType = CommandType.Text; FillParameters(_dbCommand, query.Query.CommandParams, render); if (!string.IsNullOrEmpty(query.Query.IdentityField)) { return(Convert.ToInt64(ExecuteScalar())); } return(ExecuteNonQuery()); }
public int ExecuteNonQuery(Delete query) { ISqlOmRenderer render = Qb.CreateRenderer(_anyConnection.DatabaseProvider); _dbCommand.CommandText = render.RenderDelete(query); _dbCommand.CommandType = CommandType.Text; FillParameters(_dbCommand, query.Query.CommandParams, render); using (SqlStopwatch sw = new SqlStopwatch(this)) { return(ExecuteNonQuery()); } }
public string GetSql(Update query) { ISqlOmRenderer renderer = Qb.CreateRenderer(AnyDbSetting.DatabaseProvider); return(renderer.RenderUpdate(query)); }
public string GetSql(InsertSelect query) { ISqlOmRenderer renderer = Qb.CreateRenderer(AnyDbSetting.DatabaseProvider); return(renderer.RenderInsertSelect(query)); }