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 >
8
16
9
17
## Installation
10
18
@@ -13,15 +21,16 @@ the gitql binary.
13
21
14
22
## Usage
15
23
16
- ```
24
+ ``` bash
17
25
Usage:
18
- gitql [OPTIONS] <query | version>
26
+ gitql [OPTIONS] < query | shell | version>
19
27
20
28
Help Options:
21
29
-h, --help Show this help message
22
30
23
31
Available commands:
24
32
query Execute a SQL query a repository.
33
+ shell Start an interactive session.
25
34
version Show the version information.
26
35
```
27
36
@@ -31,35 +40,58 @@ For example:
31
40
$ cd my_git_repo
32
41
$ gitql query ' SELECT hash, author_email, author_name FROM commits LIMIT 2;'
33
42
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
+ ! >
40
71
```
41
72
42
73
## Tables
43
74
44
75
gitql exposes the following tables:
45
76
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 |
51
84
52
85
## SQL syntax
53
86
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:
55
88
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 |
63
95
64
96
## License
65
97
0 commit comments