def releases(db_path, repos, auth): "Save releases for the specified repos" db = sqlite_utils.Database(db_path) token = load_token(auth) for repo in repos: repo_full = utils.fetch_repo(repo, token) utils.save_repo(db, repo_full) releases = utils.fetch_releases(repo, token) utils.save_releases(db, releases, repo_full["id"]) time.sleep(1) utils.ensure_releases_fts(db)
def releases(db_path, repos, auth): "Save releases for the specified repos" db = sqlite_utils.Database(db_path) token = load_token(auth) first = True for repo in repos: if not first: time.sleep(1) first = False repo_full = utils.fetch_repo(repo, token) utils.save_repo(db, repo_full) releases = utils.fetch_releases(repo, token) utils.save_releases(db, releases, repo_full["id"]) utils.ensure_db_shape(db)
def db(releases, repo): db = sqlite_utils.Database(memory=True) utils.save_repo(db, repo) utils.save_releases(db, releases, repo["id"]) utils.ensure_db_shape(db) return db