Skip to content

Commit

Permalink
Introduce a new table for diffs_changes to perform analysis on ever…
Browse files Browse the repository at this point in the history
…y change
  • Loading branch information
AmrDeveloper committed Jan 4, 2025
1 parent fb2e128 commit b30ee49
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 81 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ SELECT author_name, author_email FROM commits ORDER BY author_name DESC, author_
SELECT author_name, author_email FROM commits WHERE author_email LIKE "%gmail%" ORDER BY author_name
SELECT * FROM commits WHERE LOWER(author_name) = "amrdeveloper"
SELECT author_name FROM commits GROUP By author_name
SELECT author_name FROM commits GROUP By author_name having author_name = "AmrDeveloper"
SELECT author_name FROM commits GROUP By author_name HAVING author_name = "AmrDeveloper"

SELECT * FROM branches
SELECT * FROM branches WHERE is_head = true
SELECT name, LEN(name) FROM branches

SELECT * FROM tags
SELECT * FROM tags OFFSET 1 LIMIT 1

SELECT path, count() AS changes_count, SUM(insertions) AS additions, SUM(removals) AS removes FROM diffs_changes GROUP BY path ORDER BY changes_count DESC
```

---
Expand Down
13 changes: 13 additions & 0 deletions docs/structure/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ show tables

---

## Diffs Changes table

| Name | Type | Description |
| ---------- | ------- | ------------------------------------------------------------------------ |
| commit_id | Text | Commit id |
| insertions | Integer | Number of inserted lines in one change |
| removals | Integer | Number of deleted lines in one change |
| mode | Text | Change mode A for Add, D for Delete, M for Modification or R for Rewrite |
| path | Text | Location of the change |
| repo | Text | Repository full path |

---

### Branches table

| Name | Type | Description |
Expand Down
Loading

0 comments on commit b30ee49

Please sign in to comment.