centralize sql code to minimze deadlock and maximize reuse, rename
get_subscriptions since it doesn't always get all