You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the purposes below I am assuming the organization I would get all the repositories and their related commits from is called gh-organization. The github's owner id of gh-orgnization is 123456789.
github-to-sqlite repos github.db gh-organization
I'm on a windows computer running git bash to be able to use the | command. This works for me
sqlite-utils github.db "select full_name from repos where owner = 53015001 union select 'simonw/datasette' as full_name union select 'simonw/sqlite-utils' as full_name" \
I looked a bit at utils.py in the GitHub repository. I was surprised at the amount of manual mapping of the API response you had to do to get this to work.
Activity
daniel-butler commentedon Jan 29, 2021
For the purposes below I am assuming the organization I would get all the repositories and their related commits from is called
gh-organization. The github's owner id of gh-orgnization is123456789.I'm on a windows computer running git bash to be able to use the
|command. This works for meOn a pure linux system I think this would work because the new line character is normally
\nAs expected I ran into rate limit issues #51
simonw commentedon Jan 29, 2021
I really like the way you're using pipes here - really smart. It's similar to how I build the demo database in this GitHub Actions workflow:
github-to-sqlite/.github/workflows/deploy-demo.yml
Lines 52 to 82 in 62dfd3b
twitter-to-sqliteactually has a mechanism for doing this kind of thing, documented at https://github.com/dogsheep/twitter-to-sqlite#providing-input-from-a-sql-query-with---sql-and---attachIt lets you do things like:
Maybe I should add something similar to
github-to-sqlite? Feels like it could be really useful.daniel-butler commentedon Jan 30, 2021
Yes that would be cool! I wouldn't mind helping. Is this the meat of it? https://github.com/dogsheep/twitter-to-sqlite/blob/21fc1cad6dd6348c67acff90a785b458d3a81275/twitter_to_sqlite/utils.py#L512
It looks like the cli option is added with this decorator : https://github.com/dogsheep/twitter-to-sqlite/blob/21fc1cad6dd6348c67acff90a785b458d3a81275/twitter_to_sqlite/cli.py#L14
I looked a bit at utils.py in the GitHub repository. I was surprised at the amount of manual mapping of the API response you had to do to get this to work.