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: refactor the server model implement #4878

Merged
merged 9 commits into from
Dec 3, 2024

Conversation

arvinxx
Copy link
Contributor

@arvinxx arvinxx commented Dec 3, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

将 server 部分的 model 实现全部抽离 serverdb,变成 初始化实例注入,进而为客户端使用 pglite 做好铺垫。

同时目前看到 models 里还存在一些依赖 server 端环境变量的实现,后续需要针对性重构掉。

📝 补充信息 | Additional Information

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 1:30pm
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 1:30pm

@lobehubbot
Copy link
Member

👍 @arvinxx

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 97.81818% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.59%. Comparing base (3ce92b3) to head (017cef0).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/database/server/models/user.ts 96.87% 3 Missing ⚠️
src/database/server/models/message.ts 94.44% 2 Missing ⚠️
src/database/server/models/session.ts 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4878      +/-   ##
==========================================
+ Coverage   91.26%   91.59%   +0.33%     
==========================================
  Files         526      525       -1     
  Lines       37478    37466      -12     
  Branches     3500     2333    -1167     
==========================================
+ Hits        34203    34316     +113     
+ Misses       3275     3150     -125     
Flag Coverage Δ
app 91.59% <97.81%> (+0.33%) ⬆️
server 98.12% <97.81%> (+4.24%) ⬆️

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.

@arvinxx arvinxx marked this pull request as ready for review December 3, 2024 13:22
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Dec 3, 2024
@arvinxx arvinxx merged commit 3814853 into main Dec 3, 2024
11 checks passed
@arvinxx arvinxx deleted the refactor/server-db branch December 3, 2024 13:54
@lobehubbot
Copy link
Member

❤️ Great PR @arvinxx ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Dec 3, 2024
### [Version&nbsp;1.35.10](v1.35.9...v1.35.10)
<sup>Released on **2024-12-03**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the server db model implement.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

* **misc**: Refactor the server db model implement, closes [#4878](#4878) ([3814853](3814853))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.35.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Dec 3, 2024
### [Version&nbsp;1.77.6](v1.77.5...v1.77.6)
<sup>Released on **2024-12-03**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the server db model implement.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

* **misc**: Refactor the server db model implement, closes [lobehub#4878](https://github.com/bentwnghk/lobe-chat/issues/4878) ([3814853](3814853))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants