Skip to content

Commit a6fe13d

Browse files
authored
Update README (#110)
1 parent 60a18df commit a6fe13d

File tree

1 file changed

+60
-28
lines changed

1 file changed

+60
-28
lines changed

Diff for: README.md

+60-28
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
# ![gitql](https://rawgit.com/gitql/gitql/master/gitql-logo.svg)
2-
3-
[![Build Status](https://travis-ci.org/gitql/gitql.svg?branch=master)](https://travis-ci.org/gitql/gitql) [![codecov](https://codecov.io/gh/gitql/gitql/branch/master/graph/badge.svg)](https://codecov.io/gh/gitql/gitql) [![GoDoc](https://godoc.org/github.com/gitql/gitql?status.svg)](https://godoc.org/github.com/gitql/gitql)
4-
5-
**gitql** is a SQL interface to Git repositories, written in Go.
6-
7-
**WARNING: gitql is still in a very early stage of development. It is considered experimental.**
1+
<p align="center">
2+
<img src="https://rawgit.com/gitql/gitql/master/gitql-logo.svg">
3+
</p>
4+
5+
<p align="center">
6+
<a href="https://codebeat.co/projects/gb.xjqchip.workers.dev-gitql-gitql"><img alt="codebeat badge" src="https://codebeat.co/badges/ff0a63ef-e1b1-4a8a-9662-8b2ae17718fa" /></a>
7+
8+
<a href="https://travis-ci.org/gitql/gitql"><img alt="Build Status" src="https://travis-ci.org/gitql/gitql.svg?branch=master" /></a>
9+
10+
<a href="https://codecov.io/gh/gitql/gitql"><img alt="codecov" src="https://codecov.io/gh/gitql/gitql/branch/master/graph/badge.svg" /></a>
11+
12+
<a href="https://godoc.org/github.com/gitql/gitql"><img alt="GoDoc" src="https://godoc.org/github.com/gitql/gitql?status.svg" /></a>
13+
</p>
14+
15+
<a href="https://asciinema.org/a/102733?autoplay=1" target="_blank"><img src="https://asciinema.org/a/102733.png" width="979"/></a>
816

917
## Installation
1018

@@ -13,15 +21,16 @@ the gitql binary.
1321

1422
## Usage
1523

16-
```
24+
```bash
1725
Usage:
18-
gitql [OPTIONS] <query | version>
26+
gitql [OPTIONS] <query | shell | version>
1927

2028
Help Options:
2129
-h, --help Show this help message
2230

2331
Available commands:
2432
query Execute a SQL query a repository.
33+
shell Start an interactive session.
2534
version Show the version information.
2635
```
2736

@@ -31,35 +40,58 @@ For example:
3140
$ cd my_git_repo
3241
$ gitql query 'SELECT hash, author_email, author_name FROM commits LIMIT 2;'
3342
SELECT hash, author_email, author_name FROM commits LIMIT 2;
34-
+------------------------------------------+--------------------+---------------+
35-
| HASH | AUTHOR EMAIL | AUTHOR NAME |
36-
+------------------------------------------+--------------------+---------------+
37-
| 02e0aa0ef807d2ae4d02ecdbe37681db9e812544 | Santiago M. Mola | [email protected] |
38-
| 034cb63f77f4a0d30d26dabb999d348be6640df7 | Antonio J. Navarro | [email protected] |
39-
+------------------------------------------+--------------------+---------------+
43+
+------------------------------------------+---------------------+-----------------------+
44+
| HASH | AUTHOR EMAIL | AUTHOR NAME |
45+
+------------------------------------------+---------------------+-----------------------+
46+
| 003dc36e0067b25333cb5d3a5ccc31fd028a1c83 | [email protected] | Santiago M. Mola |
47+
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected] | Antonio Navarro Perez |
48+
+------------------------------------------+---------------------+-----------------------+
49+
```
50+
51+
You can use the interactive shell like you usually do to explore tables in postgreSQL per example:
52+
53+
```bash
54+
$ gitql shell
55+
56+
gitQL SHELL
57+
-----------
58+
You must end your queries with ';'
59+
60+
!> SELECT hash, author_email, author_name FROM commits LIMIT 2;
61+
62+
--> Executing query: SELECT hash, author_email, author_name FROM commits LIMIT 2;
63+
64+
+------------------------------------------+---------------------+-----------------------+
65+
| HASH | AUTHOR EMAIL | AUTHOR NAME |
66+
+------------------------------------------+---------------------+-----------------------+
67+
| 003dc36e0067b25333cb5d3a5ccc31fd028a1c83 | [email protected] | Santiago M. Mola |
68+
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected] | Antonio Navarro Perez |
69+
+------------------------------------------+---------------------+-----------------------+
70+
!>
4071
```
4172

4273
## Tables
4374

4475
gitql exposes the following tables:
4576

46-
* commits (hash, author_name, author_email, author_time, comitter_name, comitter_email, comitter_time, message)
47-
* blobs (hash, size)
48-
* references (hash, name, is_branch, is_note, is_remote, is_tag, target)
49-
* tags (hash, name, tagger_email, tagger_name, tagger_when, message, target)
50-
* tree_entries (tree_hash, entry_hash, mode, name)
77+
| Name | Columns |
78+
|:------------:|:---------------------------------------------------------------------------------------------------:|
79+
| commits | hash, author_name, author_email, author_time, comitter_name, comitter_email, comitter_time, message |
80+
| blobs | hash, size |
81+
| references | hash,hash, name, is_branch, is_note, is_remote, is_tag, target |
82+
| tags | hash, name, tagger_email, tagger_name, tagger_when, message, target |
83+
| tree_entries | tree_hash, entry_hash, mode, name |
5184

5285
## SQL syntax
5386

54-
gitql supports a subset of the SQL standard, currently including:
87+
We are continuously adding more functionality to gitql. We support a subset of the SQL standard, currently including:
5588

56-
* `SELECT`
57-
* `WHERE`
58-
* `ORDER BY` (with `ASC` and `DESC`)
59-
* `LIMIT`
60-
* `GROUP BY` (with `COUNT` and `FIRST`)
61-
* `SHOW TABLES`
62-
* `DESCRIBE TABLE`
89+
| | Supported |
90+
|:----------------------:|:---------------------------------------------------------------------------------:|
91+
| Comparison expressions | !=, ==, >, <, >=,<= |
92+
| Grouping expressions | COUNT, FIRST |
93+
| Standard expressions | ALIAS, LITERAL, STAR (*) |
94+
| Statements | CROSS JOIN, DESCRIBE, FILTER (WHERE), GROUP BY, LIMIT, SELECT, SHOW TABLES, SORT |
6395

6496
## License
6597

0 commit comments

Comments
 (0)