Skip to content

Conversation

@Odonno
Copy link
Contributor

@Odonno Odonno commented Aug 4, 2025

Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.

What does this change do?

SurrealDbClient pooling to avoid the cost of

  1. WS reconnection when using the websocket engine
  2. dropping and creating engines over and over, reducing memory pressure

The HTTP & embedded modes are not concerned as of now.

BREAKING CHANGES :

Scoped lifetime will now become the default as it should have been at the beginning. It is still possible to set another lifetime manually.

What is your testing strategy?

Integrations tests

Is this related to any issues?

Fixes #104

Have you read the Contributing Guidelines?

@Odonno Odonno force-pushed the feat/client-pooling-v2 branch 6 times, most recently from 5c40af1 to 11ce80a Compare August 4, 2025 19:54
@Odonno Odonno force-pushed the feat/client-pooling-v2 branch from 11ce80a to da24f55 Compare August 4, 2025 20:20
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 64.64380% with 134 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.06%. Comparing base (6fd2105) to head (da24f55).
⚠️ Report is 68 commits behind head on main.

Files with missing lines Patch % Lines
SurrealDb.Net/Internals/SurrealDbEngine.Ws.cs 29.82% 36 Missing and 4 partials ⚠️
...DependencyInjection/ServiceCollectionExtensions.cs 66.23% 25 Missing and 1 partial ⚠️
...alDb.Net/Internals/ObjectPool/DefaultObjectPool.cs 41.66% 20 Missing and 1 partial ⚠️
...Db.Net/Internals/ObjectPool/SurrealDbClientPool.cs 72.85% 16 Missing and 3 partials ⚠️
SurrealDb.Net/SurrealDbClient.Methods.cs 83.33% 12 Missing ⚠️
SurrealDb.Net/Internals/SurrealDbEngine.Http.cs 79.31% 5 Missing and 1 partial ⚠️
...alDb.Embedded.Internals/SurrealDbEmbeddedEngine.cs 33.33% 4 Missing ⚠️
...et/Internals/ObjectPool/AsyncPooledObjectPolicy.cs 66.66% 1 Missing and 1 partial ⚠️
...ternals/ObjectPool/SurrealDbClientPoolContainer.cs 71.42% 0 Missing and 2 partials ⚠️
SurrealDb.Net/SurrealDbClient.Base.cs 75.00% 0 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #208      +/-   ##
==========================================
+ Coverage   69.65%   71.06%   +1.41%     
==========================================
  Files         161      191      +30     
  Lines        6702     7943    +1241     
  Branches      775      838      +63     
==========================================
+ Hits         4668     5645     +977     
- Misses       1689     1963     +274     
+ Partials      345      335      -10     

☔ 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant