Hotfix/ must find

@henn pointed out that we should probably just use something from sqlalchemy to do this, but for now this will do.

I'm going to merge this in without waiting for review.