Add docstrings to sql.py
Use original time for logging hack
Fixes for delete.
fix context check in db/utils.py

The context check was causing an unnecessary fallback to sqlalchemy/api
by trying to access IMPL.is_admin