Skip to content

Commit

Permalink
Merge pull request #71 from augmentable-dev/update-readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
patrickdevivo authored Nov 15, 2020
2 parents 51eaee2 + d1d233f commit a16e65c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ Similar to `git log`, the `commits` table includes all commits in the history of
| parent_id | TEXT |
| parent_count | INT |
| tree_id | TEXT |
| additions | INT |
| deletions | INT |

#### `files`

Expand Down Expand Up @@ -160,6 +158,15 @@ Use the `commit_id` column to filter for files that belong to the work tree of a
| message | TEXT |
| target_type | TEXT |

#### `stats`

| Column | Type |
|-----------|------|
| commit_id | TEXT |
| file | TEXT |
| additions | INT |
| deletions | INT |

### Example Queries

This will return all commits in the history of the currently checked out branch/commit of the repo.
Expand Down
4 changes: 1 addition & 3 deletions pkg/gitqlite/git_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ func (m *gitLogModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTa
committer_when DATETIME,
parent_id TEXT,
parent_count INT,
tree_id TEXT,
additions INT,
deletions INT
tree_id TEXT
)`, args[0]))
if err != nil {
return nil, err
Expand Down
9 changes: 1 addition & 8 deletions pkg/gitqlite/git_log_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ func (m *gitLogCLIModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.
committer_when DATETIME,
parent_id TEXT,
parent_count INT,
tree_id TEXT,
additions INT,
deletions INT
tree_id TEXT
)`, args[0]))
if err != nil {
return nil, err
Expand Down Expand Up @@ -154,11 +152,6 @@ func (vc *commitCLICursor) Column(c *sqlite3.SQLiteContext, col int) error {
case 11:
//tree_id
c.ResultText(current.TreeID)
case 12:
c.ResultInt(current.Additions)
case 13:
c.ResultInt(current.Deletions)

}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/gitqlite/git_log_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestCommitCounts(t *testing.T) {
if err != nil {
t.Fatal(err)
}
expected := 14
expected := 12
if len(columns) != expected {
t.Fatalf("expected %d columns, got: %d", expected, len(columns))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/gitqlite/git_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestCommits(t *testing.T) {
t.Fatal(err)
}

expected := 14
expected := 12
if len(columns) != expected {
t.Fatalf("expected %d columns, got: %d", expected, len(columns))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/gitqlite/git_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (m *gitStatsModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.V
CREATE TABLE %q (
commit_id TEXT,
file TEXT,
additions TEXT,
deletions TEXT
additions INT,
deletions INT
)`, args[0]))
if err != nil {
return nil, err
Expand Down

0 comments on commit a16e65c

Please sign in to comment.