8 comments

[ 3.3 ms ] story [ 37.0 ms ] thread
I don't get this one:

    SELECT DISTINCT title AS tt message FROM commits
Is there a comma missing after tt? Or is something fancy happening?
I think it's an odd direction to go, focusing on a new "query language" and CLI tool rather than something that allows a git repo to be used as a storage backend in a normal RDBMS. Then you wouldn't have to implement the SQL grammar & logic, and you'd get a query optimizer for free. Using something like Postgres's foreign data wrappers maybe.

It doesn't look like this query language has much domain-specific syntax at all. It's just SQL with git as a storage backend.

Isn't it's purpose merely to provide a way to query a git repo's commit history? It helps answer questions like "who has the most commits in the codebase?" and "what times of the day are commits most active?". I don't think it's meant to be anything more than that.
Exactly. They only have SQL query and a fixed set of tables. No insert, update or changing database structure.
I think why they did it is to provide a uniform way to access info in already present git repositories. Without it, people probably just come up with ad hoc shell scripts (which can get out of hand when what you're looking for becomes sufficiently complex).
https://blog.datomic.com/2012/10/codeq.html

>codeq ( 'co-deck') is a little application that imports your Git repositories into a Datomic database, then performs language-aware analysis on them, extending the Git model down from the file to the code quantum (codeq) level, and up across repos. By doing so, codeq allows you to:

>Track change at the program unit level (e.g. function and method definitions)

>Query your programs and libraries declaratively, with the same cognitive units and names you use while programming

>Query across repos