Skip to content

Commit

Permalink
Update github_pull_request.md (#425)
Browse files Browse the repository at this point in the history
Trying to minimize the amount of json magic.
  • Loading branch information
judell committed Apr 29, 2024
1 parent 5127a5e commit 41b3f5f
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion docs/tables/github_pull_request.md
Expand Up @@ -253,4 +253,33 @@ where
and state = 'OPEN'
group by
repository_full_name, number, title;
```
```

OR

```sql+postgres
select
number,
created_at,
array(select jsonb_object_keys(labels)) as labels
from
github_pull_request
where
state = 'OPEN'
and repository_full_name = 'turbot/steampipe';
```

```sql+sqlite
select
number,
created_at,
(
select group_concat(key)
from json_each(labels)
) as labels
from
github_pull_request
where
state = 'OPEN'
and repository_full_name = 'turbot/steampipe';
```

0 comments on commit 41b3f5f

Please sign in to comment.