docs: def get_result(db, result_id):
      """
      :param db:
          a :class:`openquake.server.dbapi.Db` instance
      :param result_id:
          a result ID
      :returns: (job_id, job_status, datadir, datastore_key)
      """
      job = db('SELECT job.*, ds_key FROM job, output WHERE '
               'oq_job_id=job.id AND output.id=?x', result_id, one=True)
      return (job.id, job.status, job.user_name,
              os.path.dirname(job.ds_calc_dir), job.ds_key)