Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "files" column to the "github_my_gist" and "github_gist" tables. Closes #57 #66

Merged
merged 2 commits into from
Oct 4, 2021

Conversation

LalitLab
Copy link
Contributor

Example query results

Results
select
  id,
  jsonb_pretty(files) 
from
  github_my_gist;
Time: 2.430705ms
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id                               | jsonb_pretty                                                                                                                                                      |
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 02821275ccd75554bc0d1f9e685bc48f | [                                                                                                                                                                 |
|                                  |     {                                                                                                                                                             |
|                                  |         "size": 885,                                                                                                                                              |
|                                  |         "type": "application/x-sql",                                                                                                                              |
|                                  |         "raw_url": "https://gist.githubusercontent.com/LalitTurbot/02821275ccd75554bc0d1f9e685bc48f/raw/01001d1af0de8668f397785ef2675c4e0ba42362/test.sql",       |
|                                  |         "filename": "test.sql",                                                                                                                                   |
|                                  |         "language": "SQL"                                                                                                                                         |
|                                  |     }                                                                                                                                                             |
|                                  | ]                                                                                                                                                                 |
| 541e66039de47d7e295bcfa905541aef | [                                                                                                                                                                 |
|                                  |     {                                                                                                                                                             |
|                                  |         "size": 834,                                                                                                                                              |
|                                  |         "type": "video/MP2T",                                                                                                                                     |
|                                  |         "raw_url": "https://gist.githubusercontent.com/LalitTurbot/541e66039de47d7e295bcfa905541aef/raw/11c62c42e96ef3cae0cf2988cfdf135db9436b5f/init-data.ts",   |
|                                  |         "filename": "init-data.ts",                                                                                                                               |
|                                  |         "language": "TypeScript"                                                                                                                                  |
|                                  |     },                                                                                                                                                            |
|                                  |     {                                                                                                                                                             |
|                                  |         "size": 653,                                                                                                                                              |
|                                  |         "type": "application/x-python",                                                                                                                           |
|                                  |         "raw_url": "https://gist.githubusercontent.com/LalitTurbot/541e66039de47d7e295bcfa905541aef/raw/531782321567273dcb3b399225bdb28994e41679/server.py",      |
|                                  |         "filename": "server.py",                                                                                                                                  |
|                                  |         "language": "Python"                                                                                                                                      |
|                                  |     }                                                                                                                                                             |
|                                  | ]                                                                                                                                                                 |
| ef0c42aee9926b5f4ebc932782c8b825 | [                                                                                                                                                                 |
|                                  |     {                                                                                                                                                             |
|                                  |         "size": 444,                                                                                                                                              |
|                                  |         "type": "application/x-sql",                                                                                                                              |
|                                  |         "raw_url": "https://gist.githubusercontent.com/LalitTurbot/ef0c42aee9926b5f4ebc932782c8b825/raw/7836ab55a489739f0d9fed1e6d884d7fd2fdc74d/cross_join.sql", |
|                                  |         "filename": "cross_join.sql",                                                                                                                             |
|                                  |         "language": "SQL"                                                                                                                                         |
|                                  |     }                                                                                                                                                             |
|                                  | ]                                                                                                                                                                 |
+----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
select
  file ->> 'language' as language,
  count(*)
from
  github_my_gist g
cross join
  jsonb_array_elements(g.files) file
group by
  language
order by
  count desc;
Time: 452.485357ms
+------------+-------+
| language   | count |
+------------+-------+
| SQL        | 2     |
| Python     | 1     |
| TypeScript | 1     |
+------------+-------+

@LalitLab LalitLab self-assigned this Sep 30, 2021
@LalitLab LalitLab linked an issue Sep 30, 2021 that may be closed by this pull request
@cbruno10 cbruno10 merged commit 56bb26e into main Oct 4, 2021
@cbruno10 cbruno10 deleted the issue#57 branch October 4, 2021 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

report gist filenames in table_github_gist
2 participants