unstorage
unstorage copied to clipboard
feat(redis): opt-in `raw` support
Resolves #559
This change adds a new saveRawAsBinary option to the redis driver. When enabled, the driver will use the setBuffer and getBuffer methods of ioredis to directly save Buffers rather than base64 encoding and saving as a string. The option is not enabled by default as that would be a backwards incompatible change.
When #528 is implemented, this could be made the default for {type: 'bytes'}. (Perhaps then saveBytesAsBinary is a better name?) It would also be possible to drop the base64 encoding entirely and instead allow users to manually encode and save as { type: 'text' }.
Codecov Report
:x: Patch coverage is 64.15094% with 19 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 60.07%. Comparing base (4d61c78) to head (b92591e).
:warning: Report is 225 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/drivers/redis.ts | 64.15% | 11 Missing and 8 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #561 +/- ##
==========================================
- Coverage 65.05% 60.07% -4.98%
==========================================
Files 39 42 +3
Lines 4055 3702 -353
Branches 487 615 +128
==========================================
- Hits 2638 2224 -414
- Misses 1408 1467 +59
- Partials 9 11 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.