Multi-Repo Queries Now Available
You can now write SQL queries spanning more than one repo with AskGit
The latest AskGit release (v.0.4.0) now supports multi-repo queries 🎉. This has been a long-requested feature, and we’re very excited it’s now possible. This release includes a major rearchitecting of the structure of the project, an outcome of which is the use of table-valued-functions for all git functionality, which allows us to pass arguments into tables as if they were functions:
SELECT * FROM commits('https://github.com/askgitdev/askgit')
See the README for more specific usage details, but currently, the first argument to any git table is treated as a repo “specifier.” In the CLI, it will default to the current working directory, or whatever is supplied by the
—repo flag. This can be a path on disk, or an HTTP(s) remote (which will be cloned to a temporary directory).
So, if you wanted to know all the distinct authors (by name) in two repos, you could execute a query like this:
|SELECT DISTINCT(author_name) FROM commits('https://github.com/askgitdev/askgit')|
|SELECT DISTINCT(author_name) FROM commits('https://github.com/askgitdev/treequery')|
You can also try it for real on our demo site. Stay tuned for some more functionality that will make multi-repo queries a lot easier to work with if you use GitHub 😀.