I always put diced onions in with my tomatoes when I can them.
Don’t forget the onion’s good friend and cousin, garlic, for antimicrobial properties too.
As a preservative?
A family favorite is my mother's salad recipe: sliced green peppers, sliced tomatoes, sliced onions, and parsley leaves, with olive oil and salt. We call it "greasy tomatoes."