Library with a MSSQL implementation of LangGraph checkpoint saver.
Project description
LangGraph Checkpoint MSSQL
Implementation of LangGraph CheckpointSaver that uses Microsoft SQL Server.
Installation
pip install langgraph-checkpoint-mssql
Dependencies
Requires the Microsoft ODBC Driver for SQL Server. Install it from:
- Linux: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
- macOS: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/install-microsoft-odbc-driver-sql-server-macos
- Windows: https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server
Usage
[!IMPORTANT] When using the MSSQL checkpointer for the first time, make sure to call
.setup()method to create the required tables.
from langgraph.checkpoint.mssql import MSSQLSaver
write_config = {"configurable": {"thread_id": "1", "checkpoint_ns": ""}}
read_config = {"configurable": {"thread_id": "1"}}
DB_URI = "mssql+pyodbc://sa:password@localhost:1433/master?driver=ODBC+Driver+18+for+SQL+Server"
with MSSQLSaver.from_conn_string(DB_URI) as checkpointer:
# call .setup() the first time you're using the checkpointer
checkpointer.setup()
# store checkpoint
checkpointer.put(write_config, checkpoint, {}, {})
# load checkpoint
checkpointer.get(read_config)
# list checkpoints
list(checkpointer.list(read_config))
Async
from langgraph.checkpoint.mssql.aio import AsyncMSSQLSaver
async with AsyncMSSQLSaver.from_conn_string(DB_URI) as checkpointer:
await checkpointer.setup()
# store checkpoint
await checkpointer.aput(write_config, checkpoint, {}, {})
# load checkpoint
await checkpointer.aget(read_config)
# list checkpoints
[c async for c in checkpointer.alist(read_config)]
Connection String Format
mssql+pyodbc://USER:PASSWORD@HOST:PORT/DATABASE?driver=ODBC+Driver+18+for+SQL+Server
For connections requiring encryption:
mssql+pyodbc://USER:PASSWORD@HOST:PORT/DATABASE?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langgraph_checkpoint_mssql-0.1.0.tar.gz.
File metadata
- Download URL: langgraph_checkpoint_mssql-0.1.0.tar.gz
- Upload date:
- Size: 77.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d6620adbdf35777a7c61874039dd5843f02b5c2d9b5640d8e4e862faa851b85
|
|
| MD5 |
5d6f817f28b278394f53eeec2a413617
|
|
| BLAKE2b-256 |
7a6c29f6f5046786df8abee91207a5e7ce0408690db79ef17a3b20932fff5cb1
|
File details
Details for the file langgraph_checkpoint_mssql-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langgraph_checkpoint_mssql-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18a9973a03ce989ad9965f47a2c243530aacb4e80516bf7ad16b38a3af24b06d
|
|
| MD5 |
fe6ee9a1425f416679827cdaef82795e
|
|
| BLAKE2b-256 |
f6bbdfbdc80abeb1a63667f488b03bdf944c6e96ae49549e501c3f1e166cbb1d
|