Added possibility for db_query to accept different db session