mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-17 21:25:46 +02:00
The original implementation for `refresh_on_read=True` in `asearch` for AsyncSqliteStore used a CTE with an UPDATE statement, which is not well-supported by SQLite in that specific construction, leading to a syntax error. This commit changes the approach: 1. `_prepare_batch_search_queries` in `BaseSqliteStore` no longer constructs a CTE-based UPDATE. Instead, it returns a flag indicating if TTL refresh is needed for the searched items. 2. `_batch_search_ops` in both `AsyncSqliteStore` and `SqliteStore` now check this flag. If true, they perform a separate UPDATE statement after fetching the search results to refresh the TTL of those items. Additionally, a new test case `test_async_asearch_refresh_ttl` was added and existing test logic was refined to accurately verify this behavior. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: William FH <13333726+hinthornw@users.noreply.github.com> Co-authored-by: Caspar Broekhuizen <caspar@langchain.dev>