barely functional sql stuff