Heat the oil in a heavy based pan, add the onions, garlic and cook for 5-6 minutes until softened but with no colour. Add all the remaining ingredients except the lime juice and bring to the boil.
Reduce the heat to low and simmer the ketchup for 1-1¼ hours, stirring frequently.
Pass the ketchup sauce through a medium strainer or food mill and return it