Skip to content

Commit 732b83e

Browse files
committed
README improvements
Signed-off-by: Javi Fontan <[email protected]>
1 parent ab6002b commit 732b83e

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

README.md

+28-10
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ Available commands:
3030
version Show the version information.
3131
```
3232

33+
You can start a server using some repositores from `/path/to/repositories` with this command:
34+
35+
```
36+
$ gitbase server -v -g /path/to/repositories
37+
```
38+
3339
A MySQL client is needed to connect to the server. For example:
3440

3541
```bash
@@ -45,33 +51,46 @@ SELECT hash, author_email, author_name FROM commits LIMIT 2;
4551
2 rows in set (0.01 sec)
4652
```
4753

54+
### Environment variables
55+
56+
| Name | Description |
57+
|:-----------------------------|:--------------------------------------------------|
58+
| `BBLFSH_ENDPOINT` | bblfshd endpoint, default "127.0.0.1:9432" |
59+
| `GITBASE_BLOBS_MAX_SIZE` | maximum blob size to return in MiB, default 5 MiB |
60+
| `GITBASE_BLOBS_ALLOW_BINARY` | enable retrieval of binary blobs, default `false` |
61+
| `UNSTABLE_SQUASH_ENABLE` | **UNSTABLE** check *Unstable features* |
62+
4863
## Tables
4964

5065
You can execute the `SHOW TABLES` statement to get a list of the available tables.
5166
To get all the columns and types of a specific table, you can write `DESCRIBE TABLE [tablename]`.
5267

5368
gitbase exposes the following tables:
5469

55-
| Name | Columns |
56-
|:------------:|:---------------------------------------------------------------------------------------------------:|
57-
| repositories |id |
58-
| remotes |repository_id, name, push_url,fetch_url,push_refspec,fetch_refspec |
59-
| commits | hash, author_name, author_email, author_when, comitter_name, comitter_email, comitter_when, message, tree_hash |
60-
| blobs | hash, size, content |
61-
| refs | repository_id, name, hash |
62-
| tree_entries | tree_hash, entry_hash, mode, name |
70+
| Name | Columns |
71+
|:-------------|:------------------------------------------------------------------------------------------------------------------|
72+
| repositories | id |
73+
| remotes | repository_id, name, push_url, fetch_url, push_refspec, fetch_refspec |
74+
| commits | hash, author_name, author_email, author_when, committer_name, committer_email, committer_when, message, tree_hash |
75+
| blobs | hash, size, content |
76+
| refs | repository_id, name, hash |
77+
| tree_entries | tree_hash, entry_hash, mode, name |
78+
| references | repository_id, name, hash |
6379

6480
## Functions
6581

6682
To make some common tasks easier for the user, there are some functions to interact with the previous mentioned tables:
6783

6884
| Name | Description |
69-
|:------------:|:---------------------------------------------------------------------------------------------------:|
85+
|:-------------|:----------------------------------------------------------------------------------------------------|
7086
|commit_has_blob(commit_hash,blob_hash)bool| get if the specified commit contains the specified blob |
7187
|commit_has_tree(commit_hash,tree_hash)bool| get if the specified commit contains the specified tree |
7288
|history_idx(start_hash, target_hash)int| get the index of a commit in the history of another commit |
7389
|is_remote(reference_name)bool| check if the given reference name is from a remote one |
7490
|is_tag(reference_name)bool| check if the given reference name is a tag |
91+
|language(path, [blob])text| gets the language of a file given its path and the optional content of the file |
92+
|uast(blob, [lang, [xpath]])json_blob| returns an array of UAST nodes as blobs |
93+
|uast_xpath(json_blob, xpath)| performs an XPath query over the given UAST nodes |
7594

7695
## Unstable features
7796

@@ -82,7 +101,6 @@ To make some common tasks easier for the user, there are some functions to inter
82101
### Get all the HEAD references from all the repositories
83102
```sql
84103
SELECT * FROM refs WHERE name = 'HEAD'
85-
86104
```
87105

88106
### Commits that appears in more than one reference

0 commit comments

Comments
 (0)