docs: clean up old docs

This commit is contained in:
Zach Daniel 2024-04-07 09:38:11 -04:00
parent 957ac1880e
commit e6abba0de8
3 changed files with 1 additions and 40 deletions

View file

@ -1,37 +0,0 @@
# Atomics
Atomics allow you to attach expression-based changes to changesets, to be executed in the data layer when the action is performed.
For example:
```elixir
update :increment_score do
argument :points, :integer, allow_nil?: false
change atomic_update(:score, expr(score + ^arg(:points)))
end
```
## What is supported
- Atomics are only supported in update actions and upserts. In the case of upserts, the atomic changes are only applied in the case of a conflicting record.
- Attaching atomics to an action using the `atomic_update/2` change in the action, as shown in the example below.
- Attaching atomics to a changeset manually with `Ash.Changeset.atomic_update/3`
- Using calculations that don't refer to aggregates or related values in expressions
### Manually attached
```elixir
changeset
|> Ash.Changeset.atomic_update(:score, Ash.Expr.expr(score + 1))
|> Ash.update!()
```
### Upsert example
```elixir
create :upsert do
upsert? true
change set_attribute(:points, 1) # set to 1
set_on_upsert :points, expr(points + 1) # or increment existing
end
```

View file

@ -574,7 +574,7 @@ On `:update` actions, and `:destroy` actions, they now default to `require_atomi
3. the action has a manual implementation
4. the action has applicable notifiers that require the original data.
Updates and destroys that can be made fully atomic are always safe to do concurrently, and as such we now require that actions meet this criteria. See the [atomics guide](/documentation/topics/atomics.md) for more.
Updates and destroys that can be made fully atomic are always safe to do concurrently, and as such we now require that actions meet this criteria. See the [update actions guide](/documentation/topics/actions/update-actions.md#fully-atomic-updates) for more.
#### What you'll need to change

View file

@ -65,7 +65,6 @@ defmodule Ash.MixProject do
"documentation/how_to/validate-changes.md",
"documentation/how_to/auto-format-code.md",
"documentation/topics/aggregates.md",
"documentation/topics/atomics.md",
"documentation/topics/attributes.md",
"documentation/topics/calculations.md",
"documentation/topics/code-interface.md",
@ -147,7 +146,6 @@ defmodule Ash.MixProject do
"documentation/how_to/validate-changes.md",
"documentation/how_to/auto-format-code.md",
"documentation/topics/aggregates.md",
"documentation/topics/atomics.md",
"documentation/topics/attributes.md",
"documentation/topics/calculations.md",
"documentation/topics/code-interface.md",