dosubot[bot] commented on issue #7877:
URL:
https://github.com/apache/incubator-devlake/issues/7877#issuecomment-2284940545
<!-- Answer -->
To access or group by file name to get the details of the files updated
during commits in your lake database, you can use the `commit_files` table.
This table stores information about the files that have been changed by commits.
Here is an example SQL query to group by file name and get the details of
the files updated during commits:
```sql
SELECT
file_path,
COUNT(commit_sha) AS commit_count,
SUM(additions) AS total_additions,
SUM(deletions) AS total_deletions
FROM
commit_files
GROUP BY
file_path
ORDER BY
commit_count DESC;
```
This query will give you the file path, the number of commits that updated
each file, the total number of lines added, and the total number of lines
deleted for each file. Additionally, if you need more detailed information
about the commits, you can join the `commit_files` table with the `commits`
table using the `commit_sha` field.
For more information on the domain layer schema and how to customize data
models, you can refer to the [Apache DevLake Domain Layer Schema
documentation](https://devlake.apache.org/docs/Overview/Architecture/#dataflow)
<sup>[[1]](https://github.com/apache/incubator-devlake-website/blob/main/docs/DataModels/DevLakeDomainLayerSchema.md)</sup><sup>[[2]](https://github.com/apache/incubator-devlake/blob/main/backend/core/models/domainlayer/code/commit.go)</sup><sup>[[3]](https://github.com/apache/incubator-devlake-website/blob/main/versioned_docs/version-v1.0/DataModels/DevLakeDomainLayerSchema.md)</sup><sup>[[4]](https://github.com/apache/incubator-devlake-website/blob/main/versioned_docs/version-v0.16/DataModels/DevLakeDomainLayerSchema.md)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]