feat(redis): add native JSON session storage for 4.1.0
Build & Publish Package / publish (push) Successful in 49s
Build & Publish Package / publish (push) Successful in 49s
- Add opt-in SESSION_REDIS_JSON storage for asyncio Redis backends. - Check JSON command support at startup and reject JSON mode on Trio. - Read legacy strings and migrate sessions on their next save. - Validate JSON objects before transactional replacement and expiry. - Preserve tagged serialization for datetime, tuple, and other types. - Cover command contracts, error handling, and session round-trips. - Document server requirements, permissions, and migration limits. - Normalize indentation and whitespace across code, tests, and examples. - Bump the package and lockfile to 4.1.0 and update the changelog. - Refresh the locked pycparser dependency to 3.12.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
Code here is borrowed from [alekseyev/trio-redis](https://github.com/alekseyev/trio-redis), which was originally developed over at [Bogdanp/trio-redis](https://github.com/Bogdanp/trio-redis).
|
||||
|
||||
Since it has no active maintainers and no PyPI package - I am including it as-is.
|
||||
@@ -9,7 +7,7 @@ Since it has no active maintainers and no PyPI package - I am including it as-is
|
||||
```python3
|
||||
from quart_session.redis_trio import RedisTrio
|
||||
cache = RedisTrio(
|
||||
addr=b"10.0.0.3", port=6379, password=b"foo")
|
||||
addr=b"10.0.0.3", port=6379, password=b"foo")
|
||||
await cache.connect()
|
||||
|
||||
await cache.setex(key="foo", value=42, seconds=300)
|
||||
@@ -20,8 +18,8 @@ Or,
|
||||
|
||||
```python3
|
||||
async with RedisTrio() as cache:
|
||||
await cache.set("foo", 42)
|
||||
await cache.get("foo")
|
||||
await cache.set("foo", 42)
|
||||
await cache.get("foo")
|
||||
```
|
||||
|
||||
## Future work
|
||||
|
||||
Reference in New Issue
Block a user