Skip to content

Commit

Permalink
Link to example tables, closes.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw authored Nov 30, 2020
1 parent 3f24e75 commit 7d7e207
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ You can use the `--issue` option one or more times to load specific issues:

$ github-to-sqlite issues github.db simonw/datasette --issue=1

Example: [issues table](https://github-to-sqlite.dogsheep.net/github/issues)

## Fetching pull requests for a repository

While pull requests are a type of issue, you will get more information on pull requests by pulling them separately. For example, whether a pull request has been merged and when.
Expand All @@ -79,6 +81,8 @@ You can use the `--pull-request` option one or more times to load specific pull

Note that the `merged_by` column on the `pull_requests` table will only be populated for pull requests that are loaded using the `--pull-request` option - the GitHub API does not return this field for pull requests that are loaded in bulk.

Example: [pull_requests table](https://github-to-sqlite.dogsheep.net/github/pull_requests)

## Fetching issue comments for a repository

The `issue-comments` command retrieves all of the comments on all of the issues in a repository.
Expand All @@ -92,6 +96,8 @@ You can use the `--issue` option to only load comments for a specific issue with

$ github-to-sqlite issue-comments github.db simonw/datasette --issue=1

Example: [issue_comments table](https://github-to-sqlite.dogsheep.net/github/issue_comments)

## Fetching commits for a repository

The `commits` command retrieves details of all of the commits for one or more repositories. It currently fetches the sha, commit message and author and committer details - it does no retrieve the full commit body.
Expand All @@ -102,12 +108,16 @@ The command accepts one or more repositories.

By default it will stop as soon as it sees a commit that has previously been retrieved. You can force it to retrieve all commits (including those that have been previously inserted) using `--all`.

Example: [commits table](https://github-to-sqlite.dogsheep.net/github/commits)

## Fetching tags for a repository

The `tags` command retrieves all of the tags for one or more repositories.

$ github-to-sqlite tags github.db simonw/datasette simonw/sqlite-utils

Example: [tags table](https://github-to-sqlite.dogsheep.net/github/tags)

## Fetching contributors to a repository

The `contributors` command retrieves details of all of the contributors for one or more repositories.
Expand All @@ -116,6 +126,8 @@ The `contributors` command retrieves details of all of the contributors for one

The command accepts one or more repositories. It populates a `contributors` table, with foreign keys to `repos` and `users` and a `contributions` table listing the number of commits to that repository for each contributor.

Example: [contributors table](https://github-to-sqlite.dogsheep.net/github/contributors)

## Fetching repos belonging to a user or organization

The `repos` command fetches repos belonging to a user or organization.
Expand All @@ -135,6 +147,8 @@ You can pass more than one username to fetch for multiple users or organizations

Add the `--readme` option to save the README for the repo in a column called `readme`. Add `--readme-html` to save the HTML rendered version of the README into a collumn called `readme_html`.

Example: [repos table](https://github-to-sqlite.dogsheep.net/github/repos)

## Fetching specific repositories

You can use `-r` with the `repos` command one or more times to fetch just specific repositories.
Expand All @@ -149,6 +163,8 @@ The `starred` command fetches the repos that have been starred by a user.

If you are using an `auth.json` file you can omit the username to retrieve the starred repos for the authenticated user.

Example: [stars table](https://github-to-sqlite.dogsheep.net/github/stars)

## Fetching users that have starred specific repos

The `stargazers` command fetches the users that have starred the specified repos.
Expand All @@ -167,6 +183,8 @@ The `workflows` command fetches the YAML workflow configurations from each repos

You can specify one or more repository using `owner/repo` syntax.

Example: [workflows table](https://github-to-sqlite.dogsheep.net/github/workflows), [jobs table](https://github-to-sqlite.dogsheep.net/github/jobs), [steps table](https://github-to-sqlite.dogsheep.net/github/steps)

## Scraping dependents for a repository

The GitHub dependency graph can show other GitHub projects that depend on a specific repo, for example [simonw/datasette/network/dependents](https://github.com/simonw/datasette/network/dependents).
Expand All @@ -179,6 +197,8 @@ The command accepts one or more repositories.

Add `-v` for verbose output.

Example: [dependents table](https://github-to-sqlite.dogsheep.net/github/dependents)

## Fetching emojis

You can fetch a list of every emoji supported by GitHub using the `emojis` command:
Expand All @@ -194,6 +214,8 @@ If you add the `--fetch` option the command will also fetch the binary content o

You can then use the [datasette-render-images](https://github.com/simonw/datasette-render-images) plugin to browse them visually.

Example: [emojis table](https://github-to-sqlite.dogsheep.net/github/emojis)

## Making authenticated API calls

The `github-to-sqlite get` command provides a convenient shortcut for making authenticated calls to the API. Once you have created your `auth.json` file (or set a `GITHUB_TOKEN` environment variable) you can use it like this:
Expand Down

1 comment on commit 7d7e207

@simonw
Copy link
Collaborator Author

@simonw simonw commented on 7d7e207 Nov 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #56

Please sign in to comment.