Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/KOBA789/gh-sql

Query GitHub Projects with SQL
https://github.com/KOBA789/gh-sql

cli gh-extension github github-projects sql

Last synced: 29 days ago
JSON representation

Query GitHub Projects with SQL

Awesome Lists containing this project

README

        

# `gh-sql`: Query GitHub Projects (beta) with SQL

![](./docs/demo.png)

## Installation

```
gh extension install KOBA789/gh-sql
```

## Features

- `SELECT` items
- `DELETE` items
- `UPDATE` item fields
- You can not modify `Title`, `Assignees`, `Labels`, `Milestone`, or `Repository`

## Usage

```
USAGE:
gh-sql [OPTIONS]

FLAGS:
-h, --help Prints help information
-V, --version Prints version information

OPTIONS:
-e, --execute SQL statement to execute
-o, --output "table", "json" or these initial [default: table]

ARGS:


```

### eg. JSON output in non-interactive execution

- `-oj`: output as json
- `-e`: non-interactive mode

```bash
gh sql YOUR_NAME YOUR_PROJECT_NUMBER -oj -e 'select * from items;'
```

### eg. Make task list in markdown

Of course, you can also pipe it to `jq`.

```bash
gh sql YOUR_NAME YOUR_PROJECT_NUMBER -oj -e 'select * from items where Repository is not null;' | \
jq -r '"- " + .Repository + "#" + (.Issue | tostring)'
```