sinatra pg db helper