Every time that I pickle onions they are initially stored in a dark cupboard. After a month or two they are relocated to the fridge where they then appear to be good for about another six months at least.
I pickle with 5% acetic acid vinegar, whole peppercorns, slotted red chillis and sliced garlic. No additional water and no sugar. In fact I painstakingly dry the onions after brining to minimise the residual water. Nothing is cooked nor heated.