# `effect.function_persistence`

Function reads or writes stored data.

Area 3, [Logic](../topics/logic.md); not declinable; the next step is usually the agent's.

```jadpo
entity Customer {
    id: Uuid
}

function find_customer(id: Customer.id) -> Customer {
    return attempt Customer.get(id)
}
```

```text
error: A function can't call `Customer.get`
 --> main.jadpo:6:20
  |
6 |     return attempt Customer.get(id)
  |                    ^^^^^^^^^^^^ reads or writes stored data
  reason: A function is pure: it computes its result from its arguments alone, so reading and writing entities belongs in an action.
  next: Make the caller an action, or pass the data in as an argument (agent)
  rule: effect.function_persistence
  help: https://jadpo.dev/docs/errors/effect.function_persistence

check failed: 1 error, 1 file
```
