docs: def get_results(db, job_id):
      """
      :param db:
          a :class:`openquake.server.dbapi.Db` instance
      :param job_id:
          a job ID
      :returns: (datadir, datastore_keys)
      """
      ds_calc_dir = db('SELECT ds_calc_dir FROM job WHERE id=?x', job_id,
                       scalar=True)
      datadir = os.path.dirname(ds_calc_dir)
      return datadir, [output.ds_key for output in get_outputs(db, job_id)]