> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ctrlrun.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SQLiteStateStore

> Approvals, effects and evidence in one SQLite file (ARCHITECTURE §5).

`ctrlrun.SQLiteStateStore` — class, defined at `src/ctrlrun/state.py:926`

```python theme={null}
class SQLiteStateStore()
    def __init__(path: str | os.PathLike[str], clock: Callable[[], datetime])
```

Approvals, effects and evidence in one SQLite file (ARCHITECTURE §5).

This is the store that makes reservation atomic across processes (SPEC-v0.1 §5.3 E1):
every decision is taken inside `BEGIN IMMEDIATE`, which holds the database's write lock,
and `effects.effect_key` is a primary key — the `UNIQUE(effect_key)` constraint — so an
insert that races past the lock still fails rather than overwriting a reservation.

A connection is opened per thread; `sqlite3` connections are not shareable. Separate
processes simply open the same file, which is the point.

## Next

* [Python API index](/reference/api/index).
* [Get started](/get-started/quickstart) · [Why](/why).


## Related topics

- [Move from SQLite to Postgres](/cookbook/sqlite-to-postgres.md)
- [InMemoryStateStore](/reference/api/InMemoryStateStore.md)
- [PostgresStateStore](/reference/api/postgres-PostgresStateStore.md)
- [Running on Postgres](/postgres.md)
- [JSONLEventSink](/reference/api/JSONLEventSink.md)
