Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sqle/gitquery
[DEPRECATED] See https://github.com/src-d/gitbase
https://github.com/sqle/gitquery
git golang sql sql-interface
Last synced: 24 days ago
JSON representation
[DEPRECATED] See https://github.com/src-d/gitbase
- Host: GitHub
- URL: https://github.com/sqle/gitquery
- Owner: sqle
- License: mit
- Created: 2018-02-26T15:03:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-26T15:07:44.000Z (almost 7 years ago)
- Last Synced: 2024-02-14T22:35:06.039Z (10 months ago)
- Topics: git, golang, sql, sql-interface
- Language: Go
- Homepage:
- Size: 1.49 MB
- Stars: 15
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-discoveries - gitquery - SQL interface to Git repositories _(`Go`)_ (Git and Version Control Systems)
README
## Installation
Check the [Releases](https://github.com/sqle/gitquery/releases) page to download
the gitquery binary.## Usage
```bash
Usage:
gitquery [OPTIONS]Help Options:
-h, --help Show this help messageAvailable commands:
query Execute a SQL query a repository.
shell Start an interactive session.
version Show the version information.
```For example:
```bash
$ cd my_git_repo
$ gitquery query 'SELECT hash, author_email, author_name FROM commits LIMIT 2;'
SELECT hash, author_email, author_name FROM commits LIMIT 2;
+------------------------------------------+---------------------+-----------------------+
| HASH | AUTHOR EMAIL | AUTHOR NAME |
+------------------------------------------+---------------------+-----------------------+
| 003dc36e0067b25333cb5d3a5ccc31fd028a1c83 | [email protected] | Santiago M. Mola |
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected] | Antonio Navarro Perez |
+------------------------------------------+---------------------+-----------------------+
```You can use the interactive shell like you usually do to explore tables in postgreSQL per example:
```bash
$ gitquery shellgitQL SHELL
-----------
You must end your queries with ';'!> SELECT hash, author_email, author_name FROM commits LIMIT 2;
--> Executing query: SELECT hash, author_email, author_name FROM commits LIMIT 2;
+------------------------------------------+---------------------+-----------------------+
| HASH | AUTHOR EMAIL | AUTHOR NAME |
+------------------------------------------+---------------------+-----------------------+
| 003dc36e0067b25333cb5d3a5ccc31fd028a1c83 | [email protected] | Santiago M. Mola |
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected] | Antonio Navarro Perez |
+------------------------------------------+---------------------+-----------------------+
!>
```## Tables
gitquery exposes the following tables:
| Name | Columns |
|:------------:|:---------------------------------------------------------------------------------------------------:|
| commits | hash, author_name, author_email, author_time, comitter_name, comitter_email, comitter_time, message |
| blobs | hash, size |
| refs | name, type, hash, target, is_branch, is_note, is_remote, is_tag |
| tags | hash, name, tagger_email, tagger_name, tagger_when, message, target |
| tree_entries | tree_hash, entry_hash, mode, name |## SQL syntax
We are continuously adding more functionality to gitquery. We support a subset of the SQL standard, currently including:
| | Supported |
|:----------------------:|:---------------------------------------------------------------------------------:|
| Comparison expressions | !=, ==, >, <, >=,<= |
| Grouping expressions | COUNT, FIRST |
| Standard expressions | ALIAS, LITERAL, STAR (*) |
| Statements | CROSS JOIN, DESCRIBE, FILTER (WHERE), GROUP BY, LIMIT, SELECT, SHOW TABLES, SORT |## License
gitquery is licensed under the [MIT License](https://github.com/sqle/gitquery/blob/master/LICENSE).