Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(comments_get): reduce interface complexity by introducing LiteDB #800

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

qwqcode
Copy link
Member

@qwqcode qwqcode commented Mar 19, 2024

package comments_get

import "gorm.io/gorm"

// LiteDB is a simplified form of gorm.DB, made to make handling database tasks easier.
// LiteDB only has `Where` and `Scopes` methods, which simplifies the creation of queries.
// This simpler structure is especially helpful when writing test cases,
// as it can make the code more straightforward and easier to comprehend.
type liteDB interface {
	Where(query interface{}, args ...interface{}) liteDB
	Scopes(funcs ...func(liteDB) liteDB) liteDB
}

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 36.71875% with 81 lines in your changes are missing coverage. Please review.

Project coverage is 35.96%. Comparing base (b60cb58) to head (187b534).

Files Patch % Lines
server/handler/comments_get/expose.go 0.00% 29 Missing ⚠️
server/handler/comments_get/utils_list.go 0.00% 27 Missing ⚠️
server/handler/comment_list.go 0.00% 22 Missing ⚠️
internal/dao/cook.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #800      +/-   ##
==========================================
+ Coverage   34.83%   35.96%   +1.12%     
==========================================
  Files         117      126       +9     
  Lines        4805     5016     +211     
==========================================
+ Hits         1674     1804     +130     
- Misses       3024     3104      +80     
- Partials      107      108       +1     
Flag Coverage Δ
go 35.96% <36.71%> (+1.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qwqcode qwqcode merged commit c2c5a80 into master Apr 7, 2024
5 checks passed
@qwqcode qwqcode deleted the refactor/comments_get branch April 7, 2024 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant