Skip to content

Conversation

@hyprh
Copy link
Contributor

@hyprh hyprh commented Oct 23, 2025

No description provided.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 3.33092% with 1335 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.81446%. Comparing base (48378be) to head (55a22b0).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
session/database/service.go 4.01235% 619 Missing and 3 partials ⚠️
session/database/migration.go 0.00000% 327 Missing ⚠️
session/database/summary.go 0.00000% 234 Missing ⚠️
storage/database/database.go 0.00000% 86 Missing ⚠️
session/database/options.go 26.31579% 56 Missing ⚠️
session/database/models.go 0.00000% 10 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##                main        #539         +/-   ##
===================================================
- Coverage   74.83858%   74.81446%   -0.02412%     
===================================================
  Files            195         201          +6     
  Lines          29891       31260       +1369     
===================================================
+ Hits           22370       23387       +1017     
- Misses          6339        6734        +395     
+ Partials        1182        1139         -43     
Flag Coverage Δ
unittests 74.81446% <3.33092%> (-0.02412%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"time"

"gorm.io/driver/mysql"
"gorm.io/gorm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用gorm是不是有点重了。 可以考虑用内置的包?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主要是期望能直接适配pg、mysql、clickhouse

//

// Package database provides the Database instance info management.
package database
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个包名会不会太大了,要不就叫 gorm 怎样

key.AppName, key.UserID, key.SessionID).
Order("timestamp ASC").
Limit(int(count - int64(s.opts.sessionEventLimit))).
Delete(&sessionEventModel{}).Error; err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要不要考虑增加一个软删除的配置, 获取的时候加过期条件判断。如果配置了软删除选项,这里就别Delete了。 业务这边应该也有希望保留全部历史Events的诉求, 用于做一些事后的分析,效果评估的素材之类的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个可以的,我加一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants