redirector: migrate sql interface to sqlalchemy

* Replace run_sql queries with SQLAchemy query.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
32: D203 Expected 1 blank line *before* class docstring, found 0
32: D204 Expected 1 blank line *after* class docstring, found 0
42: D102 Docstring missing
48: D290 White spaces around docstring should be trimmed.