mainspring-session-sqlite
SQLite 会话后端 + RunCheckpoint 实现(T2-6):单文件、WAL、崩溃恢复、零额外依赖。
安装
pip install mainspring-session-sqlite
用法
from mainspring_session_sqlite import open_sqlite
store, checkpoint = open_sqlite(".mainspring/session.db")
await store.append("session-1", [message]) # 按 Message.id 幂等去重
history = await store.load("session-1")
runner = Runner(store=store, checkpoint=checkpoint)
append 靠唯一索引 (session_id, message_id) 去重;快照整包落库,进程被 kill 后可从最后
一次提交恢复。把 backend_factory 注入 mainspring.config.build_store,即可在 YAML 里用
session.backend: sqlite 选中它。
mainspring 工作区成员,与 core 同源。MIT。
Metadata
Release files for mainspring-session-sqlite 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mainspring_session_sqlite-0.1.0.tar.gz | 5.9 kB | With provenance | Details for mainspring_session_sqlite-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mainspring_session_sqlite-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mainspring_session_sqlite-0.1.0-py3-none-any.whl |
Total release size: 12.9 kB
Release files / mainspring_session_sqlite-0.1.0.tar.gz
| Download URL | mainspring_session_sqlite-0.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f7c514597898ae4bd364729fad789d417ec0cd09bb3ebb4695758f7e34293c4
|
|
BLAKE2b-256 checksum How to use checksums |
03becc8ed14c7dbe5e09beff07cadcf0fe845e509f741f5b380e8edfa2b16aa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logRelease files / mainspring_session_sqlite-0.1.0-py3-none-any.whl
| Download URL | mainspring_session_sqlite-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6241d940f7dbbd04b8527d880c62ad7d4e39ae60bca93bf0c6d44d6382b5f962
|
|
BLAKE2b-256 checksum How to use checksums |
ea472be177c968b37daf245e918f8c9baeca04b073ce4d243617b77d428bddc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logSecurity for mainspring-session-sqlite 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mainspring_session_sqlite-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.