Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ crates/langgraph-tracing/frontend/node_modules/*
publish.sh
publish.ps1
.codebuddy/*
AGENTS.md
6 changes: 3 additions & 3 deletions crates/langgraph-checkpoint-postgres/src/saver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ impl BaseCheckpointSaver for PostgresSaver {
fn put(
&self,
config: &RunnableConfig,
checkpoint: &Checkpoint,
checkpoint: Checkpoint,
metadata: &CheckpointMetadata,
new_versions: &ChannelVersions,
) -> Result<RunnableConfig, CheckpointError> {
Expand Down Expand Up @@ -437,7 +437,7 @@ impl BaseCheckpointSaver for PostgresSaver {
async fn aput(
&self,
config: &RunnableConfig,
checkpoint: &Checkpoint,
checkpoint: Checkpoint,
metadata: &CheckpointMetadata,
new_versions: &ChannelVersions,
) -> Result<RunnableConfig, CheckpointError> {
Expand All @@ -463,7 +463,7 @@ impl BaseCheckpointSaver for PostgresSaver {
}
}));

let checkpoint_json = serde_json::to_value(checkpoint)
let checkpoint_json = serde_json::to_value(&checkpoint)
.map_err(|e| CheckpointError::Storage(e.to_string()))?;
let metadata_json =
serde_json::to_value(metadata).map_err(|e| CheckpointError::Storage(e.to_string()))?;
Expand Down
21 changes: 0 additions & 21 deletions crates/langgraph-checkpoint-sqlite/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,6 @@ SELECT
FROM checkpoints
"#;

/// Fetch all blobs (channel values) for a given checkpoint by joining
/// `checkpoint.channel_versions` with the blobs table.
///
/// SQLite stores `version` as TEXT, while `je.value` from `json_each` may
/// be a JSON number or string depending on how the checkpoint was
/// produced. The explicit `CAST(... AS TEXT)` normalizes both sides so
/// integer and string versions compare equal.
pub const SELECT_BLOBS_SQL: &str = r#"
SELECT bl.channel, bl.type, bl.blob
FROM checkpoints cp
CROSS JOIN json_each(json_extract(cp.checkpoint, '$.channel_versions')) je
INNER JOIN checkpoint_blobs bl
ON bl.thread_id = cp.thread_id
AND bl.checkpoint_ns = cp.checkpoint_ns
AND bl.channel = je.key
AND bl.version = CAST(je.value AS TEXT)
WHERE cp.thread_id = ?1
AND cp.checkpoint_ns = ?2
AND cp.checkpoint_id = ?3
"#;

/// Fetch pending writes for a given checkpoint, ordered by task and idx.
pub const SELECT_WRITES_SQL: &str = r#"
SELECT task_id, channel, type, blob, idx, task_path
Expand Down
Loading
Loading