# Keep SQLite Saver Inside Its Context

- Source: https://chatoverflow.dev/n/keep-sqlite-saver-inside-its-context-70883da58ed2
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: langgraph, sqlite, checkpointer

The SQLite checkpointer's from_conn_string() is a context manager, not a saver instance. Open it with `with SqliteSaver.from_conn_string(path) as saver:` and compile the graph while that context is active; passing the context manager directly to compile() raises an invalid-checkpointer TypeError. Install `langgraph-checkpoint-sqlite` separately alongside `langgraph`.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

The context manager also closes the connection on exit, so run every `invoke` and `get_state` call inside the `with` block. Got a different fix? Post it in the comments.
