#
tokens: 38163/50000 3/34 files (page 2/10)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 2 of 10. Use http://codebase.md/m-gonzalo/cosa-sai?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .gitignore
├── bun.lock
├── Dockerfile
├── package.json
├── prompts
│   └── default.txt
├── README.md
├── smithery.yaml
├── src
│   ├── db.ts
│   ├── gemini.ts
│   ├── index.ts
│   ├── logger.ts
│   └── types.ts
├── test
│   ├── docs
│   │   ├── ash-docs
│   │   │   ├── ash_admin.md
│   │   │   ├── ash_appsignal.md
│   │   │   ├── ash_archival.md
│   │   │   ├── ash_authentication_phoenix.md
│   │   │   ├── ash_authentication.md
│   │   │   ├── ash_cloak.md
│   │   │   ├── ash_csv.md
│   │   │   ├── ash_cubdb.md
│   │   │   ├── ash_double_entry.md
│   │   │   ├── ash_graphql.md
│   │   │   ├── ash_json_api.md
│   │   │   ├── ash_money.md
│   │   │   ├── ash_oban.md
│   │   │   ├── ash_phoenix.md
│   │   │   ├── ash_postgres.md
│   │   │   ├── ash_rbac.md
│   │   │   ├── ash_sqlite.md
│   │   │   ├── ash_state_machine.md
│   │   │   └── ash.md
│   │   ├── bun-elysia-docs
│   │   │   ├── bun.sh.md
│   │   │   └── elysiajs.com.md
│   │   ├── javascript-docs
│   │   │   └── sample.md
│   │   └── phoenix-docs
│   │       └── phx-docs.md
│   └── prompts
│       ├── ash-framework.txt
│       ├── bun-elysia.txt
│       ├── javascript.txt
│       └── phoenix.txt
└── tsconfig.json
```

# Files

--------------------------------------------------------------------------------
/test/docs/ash-docs/ash_archival.md:
--------------------------------------------------------------------------------

```markdown
  1 | [ash\_archival](https://github.com/ash-project/ash_archival)
  2 | 
  3 | v1.0.4
  4 | 
  5 | - Pages
  6 | - Modules
  7 | 
  8 | <!--THE END-->
  9 | 
 10 | <!--THE END-->
 11 | 
 12 | Search documentation of ash\_archival
 13 | 
 14 | Settings
 15 | 
 16 | # [View Source](https://github.com/ash-project/ash_archival "View Source") API Reference ash\_archival v1.0.4
 17 | 
 18 | ## [](api-reference.html#modules)Modules
 19 | 
 20 | [AshArchival](AshArchival.html)
 21 | 
 22 | An Archival extension for [`Ash.Resource`](../ash/3.4.23/Ash.Resource.html)
 23 | 
 24 | [AshArchival.Resource](AshArchival.Resource.html)
 25 | 
 26 | Configures a resource to be archived instead of destroyed for all destroy actions.
 27 | 
 28 | [AshArchival.Resource.Info](AshArchival.Resource.Info.html)
 29 | 
 30 | Introspection helpers for [`AshArchival.Resource`](AshArchival.Resource.html)
 31 | 
 32 | [Next Page → Home](readme.html)
 33 | 
 34 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
 35 | 
 36 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 37 | [ash\_archival](https://github.com/ash-project/ash_archival)
 38 | 
 39 | v1.0.4
 40 | 
 41 | - Pages
 42 | - Modules
 43 | 
 44 | <!--THE END-->
 45 | 
 46 | <!--THE END-->
 47 | 
 48 | Search documentation of ash\_archival
 49 | 
 50 | Settings
 51 | 
 52 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival.ex#L1 "View Source") AshArchival (ash\_archival v1.0.4)
 53 | 
 54 | An Archival extension for [`Ash.Resource`](../ash/3.4.23/Ash.Resource.html)
 55 | 
 56 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
 57 | 
 58 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 59 | [ash\_archival](https://github.com/ash-project/ash_archival)
 60 | 
 61 | v1.0.4
 62 | 
 63 | - Pages
 64 | - Modules
 65 | 
 66 | <!--THE END-->
 67 | 
 68 | <!--THE END-->
 69 | 
 70 | Search documentation of ash\_archival
 71 | 
 72 | Settings
 73 | 
 74 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/resource.ex#L1 "View Source") AshArchival.Resource (ash\_archival v1.0.4)
 75 | 
 76 | Configures a resource to be archived instead of destroyed for all destroy actions.
 77 | 
 78 | For more information, see [the getting started guide](get-started-with-ash-archival.html)
 79 | 
 80 | # [](AshArchival.Resource.html#summary)Summary
 81 | 
 82 | ## [Functions](AshArchival.Resource.html#functions)
 83 | 
 84 | [archive(body)](AshArchival.Resource.html#archive/1)
 85 | 
 86 | # [](AshArchival.Resource.html#functions)Functions
 87 | 
 88 | [Link to this macro](AshArchival.Resource.html#archive/1 "Link to this macro")
 89 | 
 90 | # archive(body)
 91 | 
 92 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/resource.ex#L60 "View Source") (macro)
 93 | 
 94 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
 95 | 
 96 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 97 | [ash\_archival](https://github.com/ash-project/ash_archival)
 98 | 
 99 | v1.0.4
100 | 
101 | - Pages
102 | - Modules
103 | 
104 | <!--THE END-->
105 | 
106 | <!--THE END-->
107 | 
108 | Search documentation of ash\_archival
109 | 
110 | Settings
111 | 
112 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L1 "View Source") AshArchival.Resource.Info (ash\_archival v1.0.4)
113 | 
114 | Introspection helpers for [`AshArchival.Resource`](AshArchival.Resource.html)
115 | 
116 | # [](AshArchival.Resource.Info.html#summary)Summary
117 | 
118 | ## [Functions](AshArchival.Resource.Info.html#functions)
119 | 
120 | [archive\_archive\_related(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_archive_related/1)
121 | 
122 | A list of relationships that should have all related items archived when this is archived. Notifications are not sent for this operation.
123 | 
124 | [archive\_archive\_related!(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_archive_related!/1)
125 | 
126 | A list of relationships that should have all related items archived when this is archived. Notifications are not sent for this operation.
127 | 
128 | [archive\_attribute(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_attribute/1)
129 | 
130 | The attribute in which to store the archival flag (the current datetime).
131 | 
132 | [archive\_attribute!(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_attribute!/1)
133 | 
134 | The attribute in which to store the archival flag (the current datetime).
135 | 
136 | [archive\_attribute\_type(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_attribute_type/1)
137 | 
138 | The attribute type.
139 | 
140 | [archive\_attribute\_type!(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_attribute_type!/1)
141 | 
142 | The attribute type.
143 | 
144 | [archive\_base\_filter?(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_base_filter?/1)
145 | 
146 | Whether or not a base filter exists that applies the `is_nil(archived_at)` rule.
147 | 
148 | [archive\_exclude\_destroy\_actions(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_exclude_destroy_actions/1)
149 | 
150 | A destroy action or actions that should *not* archive, but instead be left alone. This allows for having a destroy *or* archive pattern.
151 | 
152 | [archive\_exclude\_destroy\_actions!(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_exclude_destroy_actions!/1)
153 | 
154 | A destroy action or actions that should *not* archive, but instead be left alone. This allows for having a destroy *or* archive pattern.
155 | 
156 | [archive\_exclude\_read\_actions(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_exclude_read_actions/1)
157 | 
158 | A read action or actions that should show archived items. They will not get the automatic `is_nil(archived_at)` filter.
159 | 
160 | [archive\_exclude\_read\_actions!(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_exclude_read_actions!/1)
161 | 
162 | A read action or actions that should show archived items. They will not get the automatic `is_nil(archived_at)` filter.
163 | 
164 | [archive\_exclude\_upsert\_actions(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_exclude_upsert_actions/1)
165 | 
166 | This option is deprecated as it no longer has any effect. Upserts are handled according to the upsert identity. See the upserts guide for more.
167 | 
168 | [archive\_exclude\_upsert\_actions!(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_exclude_upsert_actions!/1)
169 | 
170 | This option is deprecated as it no longer has any effect. Upserts are handled according to the upsert identity. See the upserts guide for more.
171 | 
172 | [archive\_options(dsl\_or\_extended)](AshArchival.Resource.Info.html#archive_options/1)
173 | 
174 | archive DSL options
175 | 
176 | # [](AshArchival.Resource.Info.html#functions)Functions
177 | 
178 | [Link to this function](AshArchival.Resource.Info.html#archive_archive_related/1 "Link to this function")
179 | 
180 | # archive\_archive\_related(dsl\_or\_extended)
181 | 
182 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
183 | 
184 | ```
185 | @spec archive_archive_related(dsl_or_extended :: module() | map()) ::
186 |   {:ok, [atom()]} | :error
187 | ```
188 | 
189 | A list of relationships that should have all related items archived when this is archived. Notifications are not sent for this operation.
190 | 
191 | [Link to this function](AshArchival.Resource.Info.html#archive_archive_related!/1 "Link to this function")
192 | 
193 | # archive\_archive\_related!(dsl\_or\_extended)
194 | 
195 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
196 | 
197 | ```
198 | @spec archive_archive_related!(dsl_or_extended :: module() | map()) ::
199 |   [atom()] | no_return()
200 | ```
201 | 
202 | A list of relationships that should have all related items archived when this is archived. Notifications are not sent for this operation.
203 | 
204 | [Link to this function](AshArchival.Resource.Info.html#archive_attribute/1 "Link to this function")
205 | 
206 | # archive\_attribute(dsl\_or\_extended)
207 | 
208 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
209 | 
210 | ```
211 | @spec archive_attribute(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error
212 | ```
213 | 
214 | The attribute in which to store the archival flag (the current datetime).
215 | 
216 | [Link to this function](AshArchival.Resource.Info.html#archive_attribute!/1 "Link to this function")
217 | 
218 | # archive\_attribute!(dsl\_or\_extended)
219 | 
220 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
221 | 
222 | ```
223 | @spec archive_attribute!(dsl_or_extended :: module() | map()) :: atom() | no_return()
224 | ```
225 | 
226 | The attribute in which to store the archival flag (the current datetime).
227 | 
228 | [Link to this function](AshArchival.Resource.Info.html#archive_attribute_type/1 "Link to this function")
229 | 
230 | # archive\_attribute\_type(dsl\_or\_extended)
231 | 
232 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
233 | 
234 | ```
235 | @spec archive_attribute_type(dsl_or_extended :: module() | map()) ::
236 |   {:ok, atom()} | :error
237 | ```
238 | 
239 | The attribute type.
240 | 
241 | [Link to this function](AshArchival.Resource.Info.html#archive_attribute_type!/1 "Link to this function")
242 | 
243 | # archive\_attribute\_type!(dsl\_or\_extended)
244 | 
245 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
246 | 
247 | ```
248 | @spec archive_attribute_type!(dsl_or_extended :: module() | map()) ::
249 |   atom() | no_return()
250 | ```
251 | 
252 | The attribute type.
253 | 
254 | [Link to this function](AshArchival.Resource.Info.html#archive_base_filter?/1 "Link to this function")
255 | 
256 | # archive\_base\_filter?(dsl\_or\_extended)
257 | 
258 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
259 | 
260 | ```
261 | @spec archive_base_filter?(dsl_or_extended :: module() | map()) :: atom()
262 | ```
263 | 
264 | Whether or not a base filter exists that applies the `is_nil(archived_at)` rule.
265 | 
266 | [Link to this function](AshArchival.Resource.Info.html#archive_exclude_destroy_actions/1 "Link to this function")
267 | 
268 | # archive\_exclude\_destroy\_actions(dsl\_or\_extended)
269 | 
270 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
271 | 
272 | ```
273 | @spec archive_exclude_destroy_actions(dsl_or_extended :: module() | map()) ::
274 |   {:ok, [atom()]} | :error
275 | ```
276 | 
277 | A destroy action or actions that should *not* archive, but instead be left alone. This allows for having a destroy *or* archive pattern.
278 | 
279 | [Link to this function](AshArchival.Resource.Info.html#archive_exclude_destroy_actions!/1 "Link to this function")
280 | 
281 | # archive\_exclude\_destroy\_actions!(dsl\_or\_extended)
282 | 
283 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
284 | 
285 | ```
286 | @spec archive_exclude_destroy_actions!(dsl_or_extended :: module() | map()) ::
287 |   [atom()] | no_return()
288 | ```
289 | 
290 | A destroy action or actions that should *not* archive, but instead be left alone. This allows for having a destroy *or* archive pattern.
291 | 
292 | [Link to this function](AshArchival.Resource.Info.html#archive_exclude_read_actions/1 "Link to this function")
293 | 
294 | # archive\_exclude\_read\_actions(dsl\_or\_extended)
295 | 
296 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
297 | 
298 | ```
299 | @spec archive_exclude_read_actions(dsl_or_extended :: module() | map()) ::
300 |   {:ok, [atom()]} | :error
301 | ```
302 | 
303 | A read action or actions that should show archived items. They will not get the automatic `is_nil(archived_at)` filter.
304 | 
305 | [Link to this function](AshArchival.Resource.Info.html#archive_exclude_read_actions!/1 "Link to this function")
306 | 
307 | # archive\_exclude\_read\_actions!(dsl\_or\_extended)
308 | 
309 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
310 | 
311 | ```
312 | @spec archive_exclude_read_actions!(dsl_or_extended :: module() | map()) ::
313 |   [atom()] | no_return()
314 | ```
315 | 
316 | A read action or actions that should show archived items. They will not get the automatic `is_nil(archived_at)` filter.
317 | 
318 | [Link to this function](AshArchival.Resource.Info.html#archive_exclude_upsert_actions/1 "Link to this function")
319 | 
320 | # archive\_exclude\_upsert\_actions(dsl\_or\_extended)
321 | 
322 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
323 | 
324 | ```
325 | @spec archive_exclude_upsert_actions(dsl_or_extended :: module() | map()) ::
326 |   {:ok, [atom()]} | :error
327 | ```
328 | 
329 | This option is deprecated as it no longer has any effect. Upserts are handled according to the upsert identity. See the upserts guide for more.
330 | 
331 | [Link to this function](AshArchival.Resource.Info.html#archive_exclude_upsert_actions!/1 "Link to this function")
332 | 
333 | # archive\_exclude\_upsert\_actions!(dsl\_or\_extended)
334 | 
335 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
336 | 
337 | ```
338 | @spec archive_exclude_upsert_actions!(dsl_or_extended :: module() | map()) ::
339 |   [atom()] | no_return()
340 | ```
341 | 
342 | This option is deprecated as it no longer has any effect. Upserts are handled according to the upsert identity. See the upserts guide for more.
343 | 
344 | [Link to this function](AshArchival.Resource.Info.html#archive_options/1 "Link to this function")
345 | 
346 | # archive\_options(dsl\_or\_extended)
347 | 
348 | [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/lib/ash_archival/resource/info.ex#L3 "View Source")
349 | 
350 | ```
351 | @spec archive_options(dsl_or_extended :: module() | map()) :: %{
352 |   required(atom()) => any()
353 | }
354 | ```
355 | 
356 | archive DSL options
357 | 
358 | Returns a map containing the and any configured or default values.
359 | 
360 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
361 | 
362 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
363 | [ash\_archival](https://github.com/ash-project/ash_archival)
364 | 
365 | v1.0.4
366 | 
367 | - Pages
368 | - Modules
369 | 
370 | <!--THE END-->
371 | 
372 | <!--THE END-->
373 | 
374 | Search documentation of ash\_archival
375 | 
376 | Settings
377 | 
378 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/documentation/dsls/DSL:-AshArchival.Resource.md#L1 "View Source") DSL: AshArchival.Resource
379 | 
380 | Configures a resource to be archived instead of destroyed for all destroy actions.
381 | 
382 | For more information, see [the getting started guide](get-started-with-ash-archival.html)
383 | 
384 | ## [](dsl-asharchival-resource.html#archive)archive
385 | 
386 | A section for configuring how archival is configured for a resource.
387 | 
388 | ### [](dsl-asharchival-resource.html#options)Options
389 | 
390 | NameTypeDefaultDocs[`attribute`](dsl-asharchival-resource.html#archive-attribute)`atom``:archived_at`The attribute in which to store the archival flag (the current datetime).[`attribute_type`](dsl-asharchival-resource.html#archive-attribute_type)`atom``:utc_datetime_usec`The attribute type.[`base_filter?`](dsl-asharchival-resource.html#archive-base_filter?)`atom``false`Whether or not a base filter exists that applies the `is_nil(archived_at)` rule.[`exclude_read_actions`](dsl-asharchival-resource.html#archive-exclude_read_actions)`atom | list(atom)``[]`A read action or actions that should show archived items. They will not get the automatic `is_nil(archived_at)` filter.[`exclude_upsert_actions`](dsl-asharchival-resource.html#archive-exclude_upsert_actions)`atom | list(atom)``[]`This option is deprecated as it no longer has any effect. Upserts are handled according to the upsert identity. See the upserts guide for more.[`exclude_destroy_actions`](dsl-asharchival-resource.html#archive-exclude_destroy_actions)`atom | list(atom)``[]`A destroy action or actions that should *not* archive, but instead be left alone. This allows for having a destroy *or* archive pattern.[`archive_related`](dsl-asharchival-resource.html#archive-archive_related)`list(atom)``[]`A list of relationships that should have all related items archived when this is archived. Notifications are not sent for this operation.
391 | 
392 | [← Previous Page Upserts &amp; Identities](upserts-and-identities.html)
393 | 
394 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) ([current file](https://preview.hex.pm/preview/ash_archival/1.0.4/show/documentation/dsls/DSL:-AshArchival.Resource.md)) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
395 | 
396 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
397 | [ash\_archival](https://github.com/ash-project/ash_archival)
398 | 
399 | v1.0.4
400 | 
401 | - Pages
402 | - Modules
403 | 
404 | <!--THE END-->
405 | 
406 | <!--THE END-->
407 | 
408 | Search documentation of ash\_archival
409 | 
410 | Settings
411 | 
412 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/documentation/tutorials/get-started-with-ash-archival.md#L1 "View Source") Get Started with AshArchival
413 | 
414 | ## [](get-started-with-ash-archival.html#installation)Installation
415 | 
416 | First, add the dependency to your `mix.exs` file
417 | 
418 | ```
419 | {:ash_archival, "~> 1.0.4"}
420 | ```
421 | 
422 | and add `:ash_archival` to your `.formatter.exs`
423 | 
424 | ```
425 | import_deps: [..., :ash_archival]
426 | ```
427 | 
428 | ## [](get-started-with-ash-archival.html#adding-to-a-resource)Adding to a resource
429 | 
430 | To add archival to a resource, add the extension to the resource:
431 | 
432 | ```
433 | use Ash.Resource,
434 |   extensions: [..., AshArchival.Resource]
435 | ```
436 | 
437 | And thats it! Now, when you destroy a record, it will be archived instead, using an `archived_at` attribute.
438 | 
439 | See [How Does Ash Archival Work?](get-started-with-ash-archival.html) for what modifications are made to a resource, and read on for info on the tradeoffs of leveraging `Ash.Resource.Dsl.resource.base_filter`.
440 | 
441 | ## [](get-started-with-ash-archival.html#base-filter)Base Filter
442 | 
443 | Using a `Ash.Resource.Dsl.resource.base_filter` for your `archived_at` field has a lot of benefits if you are using `ash_postgres`, but comes with one major drawback, which is that it is not possible to exclude certain read actions from archival. If you wish to use a base filter, you will need to create a separate resource to read from the archived items. We may introduce a way to bypass the base filter at some point in the future.
444 | 
445 | To add a `base_filter` and `base_filter_sql` to your resource:
446 | 
447 | ```
448 | resource do
449 |   base_filter expr(is_nil(archived_at))
450 | end
451 | 
452 | postgres do
453 |   ...
454 |   base_filter_sql "(archived_at IS NULL)"
455 | end
456 | ```
457 | 
458 | Add `base_filter? true` to the `archive` configuration of your resource to tell it that it doesn't need to add the filter itself.
459 | 
460 | ### [](get-started-with-ash-archival.html#benefits-of-base_filter)Benefits of base\_filter
461 | 
462 | 1. unique indexes will exclude archived items
463 | 2. custom indexes will exclude archived items
464 | 3. check constraints will not be applied to archived items
465 | 
466 | If you want these benefits, add the appropriate `base_filter`.
467 | 
468 | ## [](get-started-with-ash-archival.html#more)More
469 | 
470 | See the [Unarchiving guide](unarchiving.html) For more.
471 | 
472 | [← Previous Page Change Log](changelog.html)
473 | 
474 | [Next Page → Un-archiving](unarchiving.html)
475 | 
476 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) ([current file](https://preview.hex.pm/preview/ash_archival/1.0.4/show/documentation/tutorials/get-started-with-ash-archival.md)) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
477 | 
478 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
479 | [ash\_archival](https://github.com/ash-project/ash_archival)
480 | 
481 | v1.0.4
482 | 
483 | - Pages
484 | - Modules
485 | 
486 | <!--THE END-->
487 | 
488 | <!--THE END-->
489 | 
490 | Search documentation of ash\_archival
491 | 
492 | Settings
493 | 
494 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/documentation/topics/how-does-ash-archival-work.md#L1 "View Source") How does Archival Work?
495 | 
496 | We make modifications to the resource to enable soft deletes. Here's a breakdown of what the extension does:
497 | 
498 | ## [](how-does-ash-archival-work.html#resource-modifications)Resource Modifications
499 | 
500 | 1. Adds a private `archived_at` `utc_datetime_usec` attribute.
501 | 2. Adds a preparation that filters each action for `is_nil(archived_at)` (except for excluded actions, or if you have `base_filter?` set to `true`).
502 | 3. Marks all destroy actions as `soft?`, turning them into updates (except for excluded actions)
503 | 4. Adds a change to all destroy actions that sets `archived_at` to the current timestamp
504 | 5. Adds a change that will iteratively load and destroy anything configured in `AshArchival.Resource.archive.archive_related`
505 | 
506 | [← Previous Page Un-archiving](unarchiving.html)
507 | 
508 | [Next Page → Upserts &amp; Identities](upserts-and-identities.html)
509 | 
510 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) ([current file](https://preview.hex.pm/preview/ash_archival/1.0.4/show/documentation/topics/how-does-ash-archival-work.md)) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
511 | 
512 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
513 | [ash\_archival](https://github.com/ash-project/ash_archival)
514 | 
515 | v1.0.4
516 | 
517 | - Pages
518 | - Modules
519 | 
520 | <!--THE END-->
521 | 
522 | <!--THE END-->
523 | 
524 | Search documentation of ash\_archival
525 | 
526 | Settings
527 | 
528 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/README.md#L1 "View Source") Home
529 | 
530 | ![Logo](https://github.com/ash-project/ash/blob/main/logos/cropped-for-header-black-text.png?raw=true#gh-light-mode-only) ![Logo](https://github.com/ash-project/ash/blob/main/logos/cropped-for-header-white-text.png?raw=true#gh-dark-mode-only)
531 | 
532 | ![Elixir CI](https://github.com/ash-project/ash_archival/workflows/CI/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Hex version badge](https://img.shields.io/hexpm/v/ash_archival.svg)](https://hex.pm/packages/ash_archival) [![Hexdocs badge](https://img.shields.io/badge/docs-hexdocs-purple)](../ash_archival.html)
533 | 
534 | # AshArchival
535 | 
536 | AshArchival is an [Ash](../ash.html) extension that provides a push-button solution for soft deleting records, instead of destroying them.
537 | 
538 | ## [](readme.html#tutorials)Tutorials
539 | 
540 | - [Get Started with AshArchival](get-started-with-ash-archival.html)
541 | 
542 | ## [](readme.html#topics)Topics
543 | 
544 | - [How does AshArchival work?](how-does-ash-archival-work.html)
545 | - [Unarchiving](unarchiving.html)
546 | 
547 | ## [](readme.html#reference)Reference
548 | 
549 | - [AshArchival DSL](dsl-asharchival-resource.html)
550 | 
551 | [← Previous Page API Reference](api-reference.html)
552 | 
553 | [Next Page → Change Log](changelog.html)
554 | 
555 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) ([current file](https://preview.hex.pm/preview/ash_archival/1.0.4/show/README.md)) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
556 | 
557 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
558 | [ash\_archival](https://github.com/ash-project/ash_archival)
559 | 
560 | v1.0.4
561 | 
562 | - Pages
563 | - Modules
564 | 
565 | <!--THE END-->
566 | 
567 | <!--THE END-->
568 | 
569 | Search documentation of ash\_archival
570 | 
571 | Settings
572 | 
573 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/documentation/topics/unarchiving.md#L1 "View Source") Un-archiving
574 | 
575 | If you want to unarchive a resource that uses a base filter, you will need to define a separate resource that uses the same storage and has no base filter. The rest of this guide applies for folks who *aren't* using a `base_filter`.
576 | 
577 | Un-archiving can be accomplished by creating a read action that is skipped, using `exclude_read_actions`. Then, you can create an update action that sets that attribute to `nil`. For example:
578 | 
579 | ```
580 | archive do
581 |   ...
582 |   exclude_read_actions :archived
583 | end
584 | 
585 | actions do
586 |   read :archived do
587 |     filter expr(not is_nil(archived_at))
588 |   end
589 | 
590 |   update :unarchive do
591 |     change set_attribute(:archived_at, nil)
592 |     # if an individual record is used to unarchive
593 |     # it must use the `archived` read action for its atomic upgrade
594 |     atomic_upgrade_with :archived
595 |   end
596 | end
597 | ```
598 | 
599 | You could then do something like this:
600 | 
601 | ```
602 | Resource
603 | |> Ash.get!(id, action: :archived)
604 | |> Ash.Changeset.for_update(:unarchive, %{})
605 | |> Ash.update!()
606 | ```
607 | 
608 | More idiomatically, you would define a code interfaceon the domain, and call that:
609 | 
610 | ```
611 | # to unarchive by `id`
612 | Resource
613 | |> Ash.Query.for_read(:archived, %{})
614 | |> Ash.Query.filter(id == ^id)
615 | |> Domain.unarchive!()
616 | ```
617 | 
618 | [← Previous Page Get Started with AshArchival](get-started-with-ash-archival.html)
619 | 
620 | [Next Page → How does Archival Work?](how-does-ash-archival-work.html)
621 | 
622 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) ([current file](https://preview.hex.pm/preview/ash_archival/1.0.4/show/documentation/topics/unarchiving.md)) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
623 | 
624 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
625 | [ash\_archival](https://github.com/ash-project/ash_archival)
626 | 
627 | v1.0.4
628 | 
629 | - Pages
630 | - Modules
631 | 
632 | <!--THE END-->
633 | 
634 | <!--THE END-->
635 | 
636 | Search documentation of ash\_archival
637 | 
638 | Settings
639 | 
640 | # [View Source](https://github.com/ash-project/ash_archival/blob/v1.0.4/documentation/topics/upserts-and-identities.md#L1 "View Source") Upserts &amp; Identities
641 | 
642 | Its important to consider identities when using AshArchival *without* a `base_filter` set up.
643 | 
644 | If you are using a `base_filter`, then all identities implicitly include that `base_filter` in their `where` (handled by the data layer).
645 | 
646 | Take the following identities, for example:
647 | 
648 | ```
649 | identities do
650 |   identity :unique_email, [:email], where: expr(is_nil(archived_at))
651 |   # and
652 |   identity :unique_email, [:email]
653 | end
654 | ```
655 | 
656 | ## [](upserts-and-identities.html#with-is_nil-archived_at)With `is_nil(archived_at)`
657 | 
658 | Using this identity allows multiple archived records with the same email, but only one *non-archived* record per email. It enables reuse of archived email addresses for new active records, maintaining data integrity by preventing duplicate active records while preserving archived data.
659 | 
660 | When you upsert a record using this identity, it will only consider active records.
661 | 
662 | ## [](upserts-and-identities.html#without-is_nil-archived_at)Without `is_nil(archived_at)`
663 | 
664 | This identity configuration enforces strict email uniqueness across all records. Once an email is used, it can't be used again, even after that record is archived.
665 | 
666 | When you upsert a record using this identity, it will consider all records.
667 | 
668 | [← Previous Page How does Archival Work?](how-does-ash-archival-work.html)
669 | 
670 | [Next Page → DSL: AshArchival.Resource](dsl-asharchival-resource.html)
671 | 
672 | [Hex Package](https://hex.pm/packages/ash_archival/1.0.4) [Hex Preview](https://preview.hex.pm/preview/ash_archival/1.0.4) ([current file](https://preview.hex.pm/preview/ash_archival/1.0.4/show/documentation/topics/upserts-and-identities.md)) Search HexDocs [Download ePub version](ash_archival.epub "ePub version")
673 | 
674 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.31.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
675 | 
```

--------------------------------------------------------------------------------
/test/docs/ash-docs/ash_cubdb.md:
--------------------------------------------------------------------------------

```markdown
  1 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
  2 | 
  3 | v0.6.2
  4 | 
  5 | - Guides
  6 | - Modules
  7 | 
  8 | <!--THE END-->
  9 | 
 10 | <!--THE END-->
 11 | 
 12 | Search documentation of ash\_cubdb
 13 | 
 14 | Settings
 15 | 
 16 | # [View Source](https://harton.dev/james/ash_cubdb "View Source") API Reference ash\_cubdb v0.6.2
 17 | 
 18 | ## [](api-reference.html#modules)Modules
 19 | 
 20 | [AshCubDB](AshCubDB.html)
 21 | 
 22 | [`AshCubDB`](AshCubDB.html#content) is an [Ash DataLayer](https://ash-hq.org/docs/module/ash/latest/ash-datalayer) which adds support for persisting Ash resources with [CubDB](https://hex.pm/packages/cubdb).
 23 | 
 24 | [AshCubDB.DataLayer](AshCubDB.DataLayer.html)
 25 | 
 26 | A CubDB data layer for Ash.
 27 | 
 28 | [AshCubDB.Dir](AshCubDB.Dir.html)
 29 | 
 30 | Utilities for working with the underlying data directory.
 31 | 
 32 | [AshCubDB.Info](AshCubDB.Info.html)
 33 | 
 34 | Auto-generated introspection for the AshCubDB DSL.
 35 | 
 36 | [AshCubDB.Migration](AshCubDB.Migration.html)
 37 | 
 38 | We store and check metadata when opening a database to ensure that the resource and attributes match, and possibly perform migrations.
 39 | 
 40 | [AshCubDB.Query](AshCubDB.Query.html)
 41 | 
 42 | A struct which holds information about a resource query as it is being built.
 43 | 
 44 | [AshCubDB.Serde](AshCubDB.Serde.html)
 45 | 
 46 | Handle serialising and deserialising of records into CubDB.
 47 | 
 48 | [Next Page → AshCubDB](readme.html)
 49 | 
 50 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
 51 | 
 52 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 53 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
 54 | 
 55 | v0.6.2
 56 | 
 57 | - Guides
 58 | - Modules
 59 | 
 60 | <!--THE END-->
 61 | 
 62 | <!--THE END-->
 63 | 
 64 | Search documentation of ash\_cubdb
 65 | 
 66 | Settings
 67 | 
 68 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/data_layer.ex#L1 "View Source") AshCubDB.DataLayer (ash\_cubdb v0.6.2)
 69 | 
 70 | A CubDB data layer for Ash.
 71 | 
 72 | ## [](AshCubDB.DataLayer.html#module-dsl-documentation)DSL Documentation
 73 | 
 74 | ### [](AshCubDB.DataLayer.html#module-index)Index
 75 | 
 76 | - cubdb
 77 | 
 78 | ### [](AshCubDB.DataLayer.html#module-docs)Docs
 79 | 
 80 | ## [](AshCubDB.DataLayer.html#module-cubdb)cubdb
 81 | 
 82 | CubDB data layer configuration.
 83 | 
 84 | Examples:
 85 | 
 86 | ```
 87 | cubdb do
 88 |   directory "/opt/storage/my_awesome_resource"
 89 |   auto_compact? true
 90 |   auto_file_sync? true
 91 |   name :my_awesome_resource
 92 | end
 93 | ```
 94 | 
 95 | * * *
 96 | 
 97 | - `:directory` - The directory within which to store the CubDB data.  
 98 |   If none is supplied, then one will be automatically generated in the `priv` directory of the parent OTP application.
 99 | - `:otp_app` ([`atom/0`](../elixir/typespecs.html#basic-types)) - The OTP application in whose `priv` directory data should be stored.  
100 |   Only used if `directory` is not supplied. When not provided [`Application.get_application/1`](../elixir/Application.html#get_application/1) will be called for the resource.
101 | - `:auto_compact?` ([`boolean/0`](../elixir/typespecs.html#built-in-types)) - Whether or not to automatically compact the CubDB database.  
102 |   See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-is-compaction) for more information. The default value is `true`.
103 | - `:auto_file_sync?` ([`boolean/0`](../elixir/typespecs.html#built-in-types)) - Whether or not to automatically flush the buffer to disk on write.  
104 |   See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-does-file-sync-mean) The default value is `true`.
105 | - `:name` ([`atom/0`](../elixir/typespecs.html#basic-types)) - The name of the CubDB database.  
106 |   By default this is the name of the resource module, however in some (rare) circumstances you may wish to specifically name the database.
107 | 
108 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
109 | 
110 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
111 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
112 | 
113 | v0.6.2
114 | 
115 | - Guides
116 | - Modules
117 | 
118 | <!--THE END-->
119 | 
120 | <!--THE END-->
121 | 
122 | Search documentation of ash\_cubdb
123 | 
124 | Settings
125 | 
126 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/dir.ex#L1 "View Source") AshCubDB.Dir (ash\_cubdb v0.6.2)
127 | 
128 | Utilities for working with the underlying data directory.
129 | 
130 | # [](AshCubDB.Dir.html#summary)Summary
131 | 
132 | ## [Functions](AshCubDB.Dir.html#functions)
133 | 
134 | [readable?(resource)](AshCubDB.Dir.html#readable?/1)
135 | 
136 | Is the directory able to be read from by the current user?
137 | 
138 | [writable?(resource)](AshCubDB.Dir.html#writable?/1)
139 | 
140 | Is the directory able to be written to by the current user?
141 | 
142 | # [](AshCubDB.Dir.html#functions)Functions
143 | 
144 | [Link to this function](AshCubDB.Dir.html#readable?/1 "Link to this function")
145 | 
146 | # readable?(resource)
147 | 
148 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/dir.ex#L23 "View Source")
149 | 
150 | Is the directory able to be read from by the current user?
151 | 
152 | [Link to this function](AshCubDB.Dir.html#writable?/1 "Link to this function")
153 | 
154 | # writable?(resource)
155 | 
156 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/dir.ex#L11 "View Source")
157 | 
158 | Is the directory able to be written to by the current user?
159 | 
160 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
161 | 
162 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
163 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
164 | 
165 | v0.6.2
166 | 
167 | - Guides
168 | - Modules
169 | 
170 | <!--THE END-->
171 | 
172 | <!--THE END-->
173 | 
174 | Search documentation of ash\_cubdb
175 | 
176 | Settings
177 | 
178 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L1 "View Source") AshCubDB (ash\_cubdb v0.6.2)
179 | 
180 | [`AshCubDB`](AshCubDB.html#content) is an [Ash DataLayer](https://ash-hq.org/docs/module/ash/latest/ash-datalayer) which adds support for persisting Ash resources with [CubDB](https://hex.pm/packages/cubdb).
181 | 
182 | CubDB is an Elixir-based key value store which supports all Erlang-native terms. More information can be found in [the CubDB readme](https://hexdocs.pm/cubdb/readme.html).
183 | 
184 | # [](AshCubDB.html#summary)Summary
185 | 
186 | ## [Functions](AshCubDB.html#functions)
187 | 
188 | [back\_up(resource, target\_path)](AshCubDB.html#back_up/2)
189 | 
190 | Creates a backup of the database into the target directory path.
191 | 
192 | [clear(resource)](AshCubDB.html#clear/1)
193 | 
194 | Deletes all entries, resulting in an empty database.
195 | 
196 | [compact(resource)](AshCubDB.html#compact/1)
197 | 
198 | Runs a database compaction.
199 | 
200 | [compacting?(resource)](AshCubDB.html#compacting?/1)
201 | 
202 | Returns true if a compaction operation is currently running, false otherwise.
203 | 
204 | [current\_db\_file(resource)](AshCubDB.html#current_db_file/1)
205 | 
206 | Returns the path of the current database file.
207 | 
208 | [data\_dir(resource)](AshCubDB.html#data_dir/1)
209 | 
210 | Returns the path of the data directory, as given when the [`CubDB`](../cubdb/2.0.2/CubDB.html) process was started.
211 | 
212 | [dirt\_factor(resource)](AshCubDB.html#dirt_factor/1)
213 | 
214 | Returns the dirt factor.
215 | 
216 | [file\_sync(resource)](AshCubDB.html#file_sync/1)
217 | 
218 | Performs an `fsync`, forcing to flush all data that might be buffered by the OS to disk.
219 | 
220 | [halt\_compaction(resource)](AshCubDB.html#halt_compaction/1)
221 | 
222 | Stops a running compaction.
223 | 
224 | [start(resource)](AshCubDB.html#start/1)
225 | 
226 | Ensure that the CubDB process is running for the specified resource.
227 | 
228 | [stop(resource)](AshCubDB.html#stop/1)
229 | 
230 | Stop the CubDB process running for a specific resource.
231 | 
232 | # [](AshCubDB.html#functions)Functions
233 | 
234 | [Link to this function](AshCubDB.html#back_up/2 "Link to this function")
235 | 
236 | # back\_up(resource, target\_path)
237 | 
238 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L54 "View Source")
239 | 
240 | ```
241 | @spec back_up(Ash.Resource.t(), Path.t()) :: :ok | {:error, any()}
242 | ```
243 | 
244 | Creates a backup of the database into the target directory path.
245 | 
246 | Wrapper around [`CubDB.back_up/2`](../cubdb/2.0.2/CubDB.html#back_up/2)
247 | 
248 | [Link to this function](AshCubDB.html#clear/1 "Link to this function")
249 | 
250 | # clear(resource)
251 | 
252 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L67 "View Source")
253 | 
254 | ```
255 | @spec clear(Ash.Resource.t()) :: :ok
256 | ```
257 | 
258 | Deletes all entries, resulting in an empty database.
259 | 
260 | Wrapper around [`CubDB.clear/1`](../cubdb/2.0.2/CubDB.html#clear/1)
261 | 
262 | [Link to this function](AshCubDB.html#compact/1 "Link to this function")
263 | 
264 | # compact(resource)
265 | 
266 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L80 "View Source")
267 | 
268 | ```
269 | @spec compact(Ash.Resource.t()) :: :ok | {:error, any()}
270 | ```
271 | 
272 | Runs a database compaction.
273 | 
274 | Wrapper around [`CubDB.compact/1`](../cubdb/2.0.2/CubDB.html#compact/1)
275 | 
276 | [Link to this function](AshCubDB.html#compacting?/1 "Link to this function")
277 | 
278 | # compacting?(resource)
279 | 
280 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L93 "View Source")
281 | 
282 | ```
283 | @spec compacting?(Ash.Resource.t()) :: boolean()
284 | ```
285 | 
286 | Returns true if a compaction operation is currently running, false otherwise.
287 | 
288 | Wrapper around [`CubDB.compacting?/1`](../cubdb/2.0.2/CubDB.html#compacting?/1)
289 | 
290 | [Link to this function](AshCubDB.html#current_db_file/1 "Link to this function")
291 | 
292 | # current\_db\_file(resource)
293 | 
294 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L106 "View Source")
295 | 
296 | ```
297 | @spec current_db_file(Ash.Resource.t()) :: String.t()
298 | ```
299 | 
300 | Returns the path of the current database file.
301 | 
302 | Wrapper around [`CubDB.current_db_file/1`](../cubdb/2.0.2/CubDB.html#current_db_file/1)
303 | 
304 | [Link to this function](AshCubDB.html#data_dir/1 "Link to this function")
305 | 
306 | # data\_dir(resource)
307 | 
308 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L118 "View Source")
309 | 
310 | ```
311 | @spec data_dir(Ash.Resource.t()) :: String.t()
312 | ```
313 | 
314 | Returns the path of the data directory, as given when the [`CubDB`](../cubdb/2.0.2/CubDB.html) process was started.
315 | 
316 | Wrapper around [`CubDB.data_dir/1`](../cubdb/2.0.2/CubDB.html#data_dir/1)
317 | 
318 | [Link to this function](AshCubDB.html#dirt_factor/1 "Link to this function")
319 | 
320 | # dirt\_factor(resource)
321 | 
322 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L130 "View Source")
323 | 
324 | ```
325 | @spec dirt_factor(Ash.Resource.t()) :: float()
326 | ```
327 | 
328 | Returns the dirt factor.
329 | 
330 | Wrapper around [`CubDB.dirt_factor/1`](../cubdb/2.0.2/CubDB.html#dirt_factor/1)
331 | 
332 | [Link to this function](AshCubDB.html#file_sync/1 "Link to this function")
333 | 
334 | # file\_sync(resource)
335 | 
336 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L142 "View Source")
337 | 
338 | ```
339 | @spec file_sync(Ash.Resource.t()) :: :ok
340 | ```
341 | 
342 | Performs an `fsync`, forcing to flush all data that might be buffered by the OS to disk.
343 | 
344 | Wrapper around [`CubDB.file_sync/1`](../cubdb/2.0.2/CubDB.html#file_sync/1)
345 | 
346 | [Link to this function](AshCubDB.html#halt_compaction/1 "Link to this function")
347 | 
348 | # halt\_compaction(resource)
349 | 
350 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L154 "View Source")
351 | 
352 | ```
353 | @spec halt_compaction(Ash.Resource.t()) :: :ok | {:error, :no_compaction_running}
354 | ```
355 | 
356 | Stops a running compaction.
357 | 
358 | Wrapper around [`CubDB.halt_compaction/1`](../cubdb/2.0.2/CubDB.html#halt_compaction/1)
359 | 
360 | [Link to this function](AshCubDB.html#start/1 "Link to this function")
361 | 
362 | # start(resource)
363 | 
364 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L17 "View Source")
365 | 
366 | ```
367 | @spec start(Ash.Resource.t()) :: {:ok, pid()} | {:error, any()}
368 | ```
369 | 
370 | Ensure that the CubDB process is running for the specified resource.
371 | 
372 | [Link to this function](AshCubDB.html#stop/1 "Link to this function")
373 | 
374 | # stop(resource)
375 | 
376 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db.ex#L42 "View Source")
377 | 
378 | ```
379 | @spec stop(Ash.Resource.t()) :: :ok
380 | ```
381 | 
382 | Stop the CubDB process running for a specific resource.
383 | 
384 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
385 | 
386 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
387 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
388 | 
389 | v0.6.2
390 | 
391 | - Guides
392 | - Modules
393 | 
394 | <!--THE END-->
395 | 
396 | <!--THE END-->
397 | 
398 | Search documentation of ash\_cubdb
399 | 
400 | Settings
401 | 
402 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L1 "View Source") AshCubDB.Info (ash\_cubdb v0.6.2)
403 | 
404 | Auto-generated introspection for the AshCubDB DSL.
405 | 
406 | # [](AshCubDB.Info.html#summary)Summary
407 | 
408 | ## [Functions](AshCubDB.Info.html#functions)
409 | 
410 | [cubdb\_auto\_compact?(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_auto_compact?/1)
411 | 
412 | Whether or not to automatically compact the CubDB database.
413 | 
414 | [cubdb\_auto\_file\_sync?(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_auto_file_sync?/1)
415 | 
416 | Whether or not to automatically flush the buffer to disk on write.
417 | 
418 | [cubdb\_directory(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_directory/1)
419 | 
420 | The directory within which to store the CubDB data.
421 | 
422 | [cubdb\_directory!(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_directory!/1)
423 | 
424 | The directory within which to store the CubDB data.
425 | 
426 | [cubdb\_name(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_name/1)
427 | 
428 | The name of the CubDB database.
429 | 
430 | [cubdb\_name!(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_name!/1)
431 | 
432 | The name of the CubDB database.
433 | 
434 | [cubdb\_options(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_options/1)
435 | 
436 | cubdb DSL options
437 | 
438 | [cubdb\_otp\_app(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_otp_app/1)
439 | 
440 | The OTP application in whose `priv` directory data should be stored.
441 | 
442 | [cubdb\_otp\_app!(dsl\_or\_extended)](AshCubDB.Info.html#cubdb_otp_app!/1)
443 | 
444 | The OTP application in whose `priv` directory data should be stored.
445 | 
446 | [field\_layout(resource\_or\_dsl\_state)](AshCubDB.Info.html#field_layout/1)
447 | 
448 | Retrieve the cached field layout for the resource.
449 | 
450 | # [](AshCubDB.Info.html#functions)Functions
451 | 
452 | [Link to this function](AshCubDB.Info.html#cubdb_auto_compact?/1 "Link to this function")
453 | 
454 | # cubdb\_auto\_compact?(dsl\_or\_extended)
455 | 
456 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
457 | 
458 | ```
459 | @spec cubdb_auto_compact?(dsl_or_extended :: module() | map()) :: boolean()
460 | ```
461 | 
462 | Whether or not to automatically compact the CubDB database.
463 | 
464 | See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-is-compaction) for more information.
465 | 
466 | [Link to this function](AshCubDB.Info.html#cubdb_auto_file_sync?/1 "Link to this function")
467 | 
468 | # cubdb\_auto\_file\_sync?(dsl\_or\_extended)
469 | 
470 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
471 | 
472 | ```
473 | @spec cubdb_auto_file_sync?(dsl_or_extended :: module() | map()) :: boolean()
474 | ```
475 | 
476 | Whether or not to automatically flush the buffer to disk on write.
477 | 
478 | See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-does-file-sync-mean)
479 | 
480 | [Link to this function](AshCubDB.Info.html#cubdb_directory/1 "Link to this function")
481 | 
482 | # cubdb\_directory(dsl\_or\_extended)
483 | 
484 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
485 | 
486 | ```
487 | @spec cubdb_directory(dsl_or_extended :: module() | map()) ::
488 |   {:ok, nil | String.t()} | :error
489 | ```
490 | 
491 | The directory within which to store the CubDB data.
492 | 
493 | If none is supplied, then one will be automatically generated in the `priv` directory of the parent OTP application.
494 | 
495 | [Link to this function](AshCubDB.Info.html#cubdb_directory!/1 "Link to this function")
496 | 
497 | # cubdb\_directory!(dsl\_or\_extended)
498 | 
499 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
500 | 
501 | ```
502 | @spec cubdb_directory!(dsl_or_extended :: module() | map()) ::
503 |   (nil | String.t()) | no_return()
504 | ```
505 | 
506 | The directory within which to store the CubDB data.
507 | 
508 | If none is supplied, then one will be automatically generated in the `priv` directory of the parent OTP application.
509 | 
510 | [Link to this function](AshCubDB.Info.html#cubdb_name/1 "Link to this function")
511 | 
512 | # cubdb\_name(dsl\_or\_extended)
513 | 
514 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
515 | 
516 | ```
517 | @spec cubdb_name(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error
518 | ```
519 | 
520 | The name of the CubDB database.
521 | 
522 | By default this is the name of the resource module, however in some (rare) circumstances you may wish to specifically name the database.
523 | 
524 | [Link to this function](AshCubDB.Info.html#cubdb_name!/1 "Link to this function")
525 | 
526 | # cubdb\_name!(dsl\_or\_extended)
527 | 
528 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
529 | 
530 | ```
531 | @spec cubdb_name!(dsl_or_extended :: module() | map()) :: atom() | no_return()
532 | ```
533 | 
534 | The name of the CubDB database.
535 | 
536 | By default this is the name of the resource module, however in some (rare) circumstances you may wish to specifically name the database.
537 | 
538 | [Link to this function](AshCubDB.Info.html#cubdb_options/1 "Link to this function")
539 | 
540 | # cubdb\_options(dsl\_or\_extended)
541 | 
542 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
543 | 
544 | ```
545 | @spec cubdb_options(dsl_or_extended :: module() | map()) :: %{
546 |   required(atom()) => any()
547 | }
548 | ```
549 | 
550 | cubdb DSL options
551 | 
552 | Returns a map containing the and any configured or default values.
553 | 
554 | [Link to this function](AshCubDB.Info.html#cubdb_otp_app/1 "Link to this function")
555 | 
556 | # cubdb\_otp\_app(dsl\_or\_extended)
557 | 
558 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
559 | 
560 | ```
561 | @spec cubdb_otp_app(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error
562 | ```
563 | 
564 | The OTP application in whose `priv` directory data should be stored.
565 | 
566 | Only used if `directory` is not supplied. When not provided [`Application.get_application/1`](../elixir/Application.html#get_application/1) will be called for the resource.
567 | 
568 | [Link to this function](AshCubDB.Info.html#cubdb_otp_app!/1 "Link to this function")
569 | 
570 | # cubdb\_otp\_app!(dsl\_or\_extended)
571 | 
572 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L6 "View Source")
573 | 
574 | ```
575 | @spec cubdb_otp_app!(dsl_or_extended :: module() | map()) :: atom() | no_return()
576 | ```
577 | 
578 | The OTP application in whose `priv` directory data should be stored.
579 | 
580 | Only used if `directory` is not supplied. When not provided [`Application.get_application/1`](../elixir/Application.html#get_application/1) will be called for the resource.
581 | 
582 | [Link to this function](AshCubDB.Info.html#field_layout/1 "Link to this function")
583 | 
584 | # field\_layout(resource\_or\_dsl\_state)
585 | 
586 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/info.ex#L13 "View Source")
587 | 
588 | ```
589 | @spec field_layout(Ash.Resource.t() | Spark.Dsl.t()) :: nil | {tuple(), tuple()}
590 | ```
591 | 
592 | Retrieve the cached field layout for the resource.
593 | 
594 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
595 | 
596 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
597 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
598 | 
599 | v0.6.2
600 | 
601 | - Guides
602 | - Modules
603 | 
604 | <!--THE END-->
605 | 
606 | <!--THE END-->
607 | 
608 | Search documentation of ash\_cubdb
609 | 
610 | Settings
611 | 
612 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/migration.ex#L1 "View Source") AshCubDB.Migration (ash\_cubdb v0.6.2)
613 | 
614 | We store and check metadata when opening a database to ensure that the resource and attributes match, and possibly perform migrations.
615 | 
616 | # [](AshCubDB.Migration.html#summary)Summary
617 | 
618 | ## [Functions](AshCubDB.Migration.html#functions)
619 | 
620 | [check(db, resource)](AshCubDB.Migration.html#check/2)
621 | 
622 | Check that a newly opened database doesn't need to be migrated.
623 | 
624 | # [](AshCubDB.Migration.html#functions)Functions
625 | 
626 | [Link to this function](AshCubDB.Migration.html#check/2 "Link to this function")
627 | 
628 | # check(db, resource)
629 | 
630 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/migration.ex#L13 "View Source")
631 | 
632 | ```
633 | @spec check(GenServer.server(), Ash.Resource.t()) :: :ok | {:error, any()}
634 | ```
635 | 
636 | Check that a newly opened database doesn't need to be migrated.
637 | 
638 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
639 | 
640 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
641 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
642 | 
643 | v0.6.2
644 | 
645 | - Guides
646 | - Modules
647 | 
648 | <!--THE END-->
649 | 
650 | <!--THE END-->
651 | 
652 | Search documentation of ash\_cubdb
653 | 
654 | Settings
655 | 
656 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/query.ex#L1 "View Source") AshCubDB.Query (ash\_cubdb v0.6.2)
657 | 
658 | A struct which holds information about a resource query as it is being built.
659 | 
660 | # [](AshCubDB.Query.html#summary)Summary
661 | 
662 | ## [Types](AshCubDB.Query.html#types)
663 | 
664 | [t()](AshCubDB.Query.html#t:t/0)
665 | 
666 | # [](AshCubDB.Query.html#types)Types
667 | 
668 | [Link to this type](AshCubDB.Query.html#t:t/0 "Link to this type")
669 | 
670 | # t()
671 | 
672 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/query.ex#L21 "View Source")
673 | 
674 | ```
675 | @type t() :: %AshCubDB.Query{
676 |   aggregates: [Ash.Resource.Aggregate.t()],
677 |   calculations: [Ash.Resource.Calculation.t()],
678 |   distinct: Ash.Sort.t(),
679 |   distinct_sort: Ash.Sort.t(),
680 |   domain: Ash.Domain.t(),
681 |   filter: nil | Ash.Filter.t(),
682 |   limit: :infinity | non_neg_integer(),
683 |   offset: non_neg_integer(),
684 |   relationships: %{
685 |     optional(atom()) => Ash.Resource.Relationships.relationship()
686 |   },
687 |   resource: Ash.Resource.t(),
688 |   sort: nil | Ash.Sort.t(),
689 |   tenant: any()
690 | }
691 | ```
692 | 
693 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
694 | 
695 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
696 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
697 | 
698 | v0.6.2
699 | 
700 | - Guides
701 | - Modules
702 | 
703 | <!--THE END-->
704 | 
705 | <!--THE END-->
706 | 
707 | Search documentation of ash\_cubdb
708 | 
709 | Settings
710 | 
711 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/serde.ex#L1 "View Source") AshCubDB.Serde (ash\_cubdb v0.6.2)
712 | 
713 | Handle serialising and deserialising of records into CubDB.
714 | 
715 | # [](AshCubDB.Serde.html#summary)Summary
716 | 
717 | ## [Functions](AshCubDB.Serde.html#functions)
718 | 
719 | [deserialise(resource, key, data)](AshCubDB.Serde.html#deserialise/3)
720 | 
721 | Convert the key and data back into a record..
722 | 
723 | [serialise(record)](AshCubDB.Serde.html#serialise/1)
724 | 
725 | Serialise the record into key and value tuples for storage in CubDB.
726 | 
727 | # [](AshCubDB.Serde.html#functions)Functions
728 | 
729 | [Link to this function](AshCubDB.Serde.html#deserialise/3 "Link to this function")
730 | 
731 | # deserialise(resource, key, data)
732 | 
733 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/serde.ex#L38 "View Source")
734 | 
735 | ```
736 | @spec deserialise(Ash.Resource.t(), tuple(), tuple()) ::
737 |   {:ok, Ash.Resource.record()} | {:error, any()}
738 | ```
739 | 
740 | Convert the key and data back into a record..
741 | 
742 | [Link to this function](AshCubDB.Serde.html#serialise/1 "Link to this function")
743 | 
744 | # serialise(record)
745 | 
746 | [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/lib/ash_cub_db/serde.ex#L14 "View Source")
747 | 
748 | ```
749 | @spec serialise(Ash.Resource.record()) :: {:ok, tuple(), tuple()} | {:error, any()}
750 | ```
751 | 
752 | Serialise the record into key and value tuples for storage in CubDB.
753 | 
754 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) Search HexDocs
755 | 
756 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
757 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
758 | 
759 | v0.6.2
760 | 
761 | - Guides
762 | - Modules
763 | 
764 | <!--THE END-->
765 | 
766 | <!--THE END-->
767 | 
768 | Search documentation of ash\_cubdb
769 | 
770 | Settings
771 | 
772 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/documentation/dsls/DSL:-AshCubDB.DataLayer.md#L1 "View Source") DSL: AshCubDB.DataLayer
773 | 
774 | A CubDB data layer for Ash.
775 | 
776 | ## [](dsl-ashcubdb-datalayer.html#dsl-documentation)DSL Documentation
777 | 
778 | ### [](dsl-ashcubdb-datalayer.html#index)Index
779 | 
780 | - cubdb
781 | 
782 | ### [](dsl-ashcubdb-datalayer.html#docs)Docs
783 | 
784 | ## [](dsl-ashcubdb-datalayer.html#cubdb)cubdb
785 | 
786 | CubDB data layer configuration.
787 | 
788 | Examples:
789 | 
790 | ```
791 | cubdb do
792 |   directory "/opt/storage/my_awesome_resource"
793 |   auto_compact? true
794 |   auto_file_sync? true
795 |   name :my_awesome_resource
796 | end
797 | ```
798 | 
799 | * * *
800 | 
801 | - `:directory` - The directory within which to store the CubDB data.  
802 |   If none is supplied, then one will be automatically generated in the `priv` directory of the parent OTP application.
803 | - `:otp_app` ([`atom/0`](../elixir/typespecs.html#basic-types)) - The OTP application in whose `priv` directory data should be stored.  
804 |   Only used if `directory` is not supplied. When not provided [`Application.get_application/1`](../elixir/Application.html#get_application/1) will be called for the resource.
805 | - `:auto_compact?` ([`boolean/0`](../elixir/typespecs.html#built-in-types)) - Whether or not to automatically compact the CubDB database.  
806 |   See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-is-compaction) for more information. The default value is `true`.
807 | - `:auto_file_sync?` ([`boolean/0`](../elixir/typespecs.html#built-in-types)) - Whether or not to automatically flush the buffer to disk on write.  
808 |   See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-does-file-sync-mean) The default value is `true`.
809 | - `:name` ([`atom/0`](../elixir/typespecs.html#basic-types)) - The name of the CubDB database.  
810 |   By default this is the name of the resource module, however in some (rare) circumstances you may wish to specifically name the database.
811 | 
812 | ## [](dsl-ashcubdb-datalayer.html#cubdb-1)cubdb
813 | 
814 | CubDB data layer configuration.
815 | 
816 | ### [](dsl-ashcubdb-datalayer.html#examples)Examples
817 | 
818 | ```
819 | cubdb do
820 |   directory "/opt/storage/my_awesome_resource"
821 |   auto_compact? true
822 |   auto_file_sync? true
823 |   name :my_awesome_resource
824 | end
825 | ```
826 | 
827 | ### [](dsl-ashcubdb-datalayer.html#options)Options
828 | 
829 | NameTypeDefaultDocs[`directory`](dsl-ashcubdb-datalayer.html#cubdb-directory)`nil | String.t`The directory within which to store the CubDB data. If none is supplied, then one will be automatically generated in the `priv` directory of the parent OTP application.[`otp_app`](dsl-ashcubdb-datalayer.html#cubdb-otp_app)`atom`The OTP application in whose `priv` directory data should be stored. Only used if `directory` is not supplied. When not provided [`Application.get_application/1`](../elixir/Application.html#get_application/1) will be called for the resource.[`auto_compact?`](dsl-ashcubdb-datalayer.html#cubdb-auto_compact?)`boolean``true`Whether or not to automatically compact the CubDB database. See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-is-compaction) for more information.[`auto_file_sync?`](dsl-ashcubdb-datalayer.html#cubdb-auto_file_sync?)`boolean``true`Whether or not to automatically flush the buffer to disk on write. See [the CubDB documentation](https://hexdocs.pm/cubdb/faq.html#what-does-file-sync-mean)[`name`](dsl-ashcubdb-datalayer.html#cubdb-name)`atom`The name of the CubDB database. By default this is the name of the resource module, however in some (rare) circumstances you may wish to specifically name the database.
830 | 
831 | [← Previous Page Change Log](changelog.html)
832 | 
833 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) ([current file](https://preview.hex.pm/preview/ash_cubdb/0.6.2/show/documentation/dsls/DSL:-AshCubDB.DataLayer.md)) Search HexDocs
834 | 
835 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
836 | [ash\_cubdb](https://harton.dev/james/ash_cubdb)
837 | 
838 | v0.6.2
839 | 
840 | - Guides
841 | - Modules
842 | 
843 | <!--THE END-->
844 | 
845 | <!--THE END-->
846 | 
847 | Search documentation of ash\_cubdb
848 | 
849 | Settings
850 | 
851 | # [View Source](https://harton.dev/james/ash_cub_db/src/branch/main/README.md#L1 "View Source") AshCubDB
852 | 
853 | [![Build Status](https://drone.harton.dev/api/badges/james/ash_cubdb/status.svg?ref=refs%2Fheads%2Fmain)](https://drone.harton.dev/james/ash_cubdb) [![Hex.pm](https://img.shields.io/hexpm/v/ash_cubdb.svg)](https://hex.pm/packages/ash_cubdb) [![Hippocratic License HL3-FULL](https://img.shields.io/static/v1?label=Hippocratic%20License&message=HL3-FULL&labelColor=5e2751&color=bc8c3d)](https://firstdonoharm.dev/version/3/0/full.html)
854 | 
855 | An [Ash DataLayer](https://ash-hq.org/docs/module/ash/latest/ash-datalayer) which adds support for [CubDB](https://hex.pm/packages/cubdb).
856 | 
857 | ## [](readme.html#status)Status
858 | 
859 | AshCubDb is still a work in progress. Feel free to give it a go.
860 | 
861 | FeatureStatusCreate✅Upsert (by primary key)✅Upsert (by identity)❌Read (all)✅Read (by primary key)✅Read (filters)✅Read (sort)✅Read (distinct sort)✅Read (calculations)✅Read (aggregates)❌Update✅Destroy✅Transactions❌
862 | 
863 | ## [](readme.html#github-mirror)Github Mirror
864 | 
865 | This repository is mirrored [on Github](https://github.com/jimsynz/ash_cubdb) from it's primary location [on my Forgejo instance](https://harton.dev/james/ash_cubdb). Feel free to raise issues and open PRs on Github.
866 | 
867 | ## [](readme.html#installation)Installation
868 | 
869 | AshCubDB is [available in Hex](https://hex.pm/packages/ash_cubdb), the package can be installed by adding `ash_cubdb` to your list of dependencies in `mix.exs`:
870 | 
871 | ```
872 | def deps do
873 |   [
874 |     {:ash_cubdb, "~> 0.6.2"}
875 |   ]
876 | end
877 | ```
878 | 
879 | Documentation for the latest release can be found on [HexDocs](../ash_cubdb.html) and for the `main` branch on [docs.harton.nz](https://docs.harton.nz/james/ash_cubdb).
880 | 
881 | ## [](readme.html#license)License
882 | 
883 | This software is licensed under the terms of the [HL3-FULL](https://firstdonoharm.dev), see the `LICENSE.md` file included with this package for the terms.
884 | 
885 | This license actively proscribes this software being used by and for some industries, countries and activities. If your usage of this software doesn't comply with the terms of this license, then [contact me](mailto:[email protected]) with the details of your use-case to organise the purchase of a license - the cost of which may include a donation to a suitable charity or NGO.
886 | 
887 | [← Previous Page API Reference](api-reference.html)
888 | 
889 | [Next Page → Change Log](changelog.html)
890 | 
891 | [Hex Package](https://hex.pm/packages/ash_cubdb/0.6.2) [Hex Preview](https://preview.hex.pm/preview/ash_cubdb/0.6.2) ([current file](https://preview.hex.pm/preview/ash_cubdb/0.6.2/show/README.md)) Search HexDocs
892 | 
893 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.32.2) for the [Elixir programming language](https://elixir-lang.org "Elixir")
894 | 
```

--------------------------------------------------------------------------------
/test/docs/ash-docs/ash_double_entry.md:
--------------------------------------------------------------------------------

```markdown
   1 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
   2 | 
   3 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
   4 | 
   5 | v1.0.10
   6 | 
   7 | - Pages
   8 | - Modules
   9 | - Mix Tasks
  10 | 
  11 | <!--THE END-->
  12 | 
  13 | <!--THE END-->
  14 | 
  15 | <!--THE END-->
  16 | 
  17 | Search documentation of ash\_double\_entry
  18 | 
  19 | Settings
  20 | 
  21 | # [View Source](https://github.com/ash-project/ash_double_entry "View Source") API Reference ash\_double\_entry v1.0.10
  22 | 
  23 | ## [](api-reference.html#modules)Modules
  24 | 
  25 | [AshDoubleEntry.Account](AshDoubleEntry.Account.html)
  26 | 
  27 | An extension for creating a double entry ledger account. See the getting started guide for more.
  28 | 
  29 | [AshDoubleEntry.Account.Info](AshDoubleEntry.Account.Info.html)
  30 | 
  31 | Introspection helpers for [`AshDoubleEntry.Account`](AshDoubleEntry.Account.html)
  32 | 
  33 | [AshDoubleEntry.Balance](AshDoubleEntry.Balance.html)
  34 | 
  35 | An extension for creating a double entry ledger balance. See the getting started guide for more.
  36 | 
  37 | [AshDoubleEntry.Balance.Info](AshDoubleEntry.Balance.Info.html)
  38 | 
  39 | Introspection helpers for [`AshDoubleEntry.Balance`](AshDoubleEntry.Balance.html)
  40 | 
  41 | [AshDoubleEntry.Transfer](AshDoubleEntry.Transfer.html)
  42 | 
  43 | An extension for creating a double entry ledger transfer. See the getting started guide for more.
  44 | 
  45 | [AshDoubleEntry.Transfer.Info](AshDoubleEntry.Transfer.Info.html)
  46 | 
  47 | Introspection helpers for [`AshDoubleEntry.Transfer`](AshDoubleEntry.Transfer.html)
  48 | 
  49 | [AshDoubleEntry.ULID](AshDoubleEntry.ULID.html)
  50 | 
  51 | An Ash type for ULID strings.
  52 | 
  53 | ## [](api-reference.html#mix-tasks)Mix Tasks
  54 | 
  55 | [mix ash\_double\_entry.install](Mix.Tasks.AshDoubleEntry.Install.html)
  56 | 
  57 | Installs AshDoubleEntry
  58 | 
  59 | [Next Page → Home](readme.html)
  60 | 
  61 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
  62 | 
  63 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
  64 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
  65 | 
  66 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
  67 | 
  68 | v1.0.10
  69 | 
  70 | - Pages
  71 | - Modules
  72 | - Mix Tasks
  73 | 
  74 | <!--THE END-->
  75 | 
  76 | <!--THE END-->
  77 | 
  78 | <!--THE END-->
  79 | 
  80 | Search documentation of ash\_double\_entry
  81 | 
  82 | Settings
  83 | 
  84 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/account.ex#L1 "View Source") AshDoubleEntry.Account (ash\_double\_entry v1.0.10)
  85 | 
  86 | An extension for creating a double entry ledger account. See the getting started guide for more.
  87 | 
  88 | # [](AshDoubleEntry.Account.html#summary)Summary
  89 | 
  90 | ## [Functions](AshDoubleEntry.Account.html#functions)
  91 | 
  92 | [account(body)](AshDoubleEntry.Account.html#account/1)
  93 | 
  94 | # [](AshDoubleEntry.Account.html#functions)Functions
  95 | 
  96 | [](AshDoubleEntry.Account.html#account/1)
  97 | 
  98 | # account(body)
  99 | 
 100 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/account.ex#L39)(macro)
 101 | 
 102 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 103 | 
 104 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 105 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
 106 | 
 107 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
 108 | 
 109 | v1.0.10
 110 | 
 111 | - Pages
 112 | - Modules
 113 | - Mix Tasks
 114 | 
 115 | <!--THE END-->
 116 | 
 117 | <!--THE END-->
 118 | 
 119 | <!--THE END-->
 120 | 
 121 | Search documentation of ash\_double\_entry
 122 | 
 123 | Settings
 124 | 
 125 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L1 "View Source") AshDoubleEntry.Account.Info (ash\_double\_entry v1.0.10)
 126 | 
 127 | Introspection helpers for [`AshDoubleEntry.Account`](AshDoubleEntry.Account.html)
 128 | 
 129 | # [](AshDoubleEntry.Account.Info.html#summary)Summary
 130 | 
 131 | ## [Functions](AshDoubleEntry.Account.Info.html#functions)
 132 | 
 133 | [account\_balance\_resource(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_balance_resource/1)
 134 | 
 135 | The resource used for balances
 136 | 
 137 | [account\_balance\_resource!(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_balance_resource!/1)
 138 | 
 139 | The resource used for balances
 140 | 
 141 | [account\_open\_action\_accept(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_open_action_accept/1)
 142 | 
 143 | A list of extra attributes to be accepted by the open action. The `identifier` and `currency` attributes are always accepted.
 144 | 
 145 | [account\_open\_action\_accept!(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_open_action_accept!/1)
 146 | 
 147 | A list of extra attributes to be accepted by the open action. The `identifier` and `currency` attributes are always accepted.
 148 | 
 149 | [account\_options(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_options/1)
 150 | 
 151 | account DSL options
 152 | 
 153 | [account\_pre\_check\_identities\_with(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_pre_check_identities_with/1)
 154 | 
 155 | A domain to use to precheck generated identities. Required by certain data layers.
 156 | 
 157 | [account\_pre\_check\_identities\_with!(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_pre_check_identities_with!/1)
 158 | 
 159 | A domain to use to precheck generated identities. Required by certain data layers.
 160 | 
 161 | [account\_transfer\_resource(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_transfer_resource/1)
 162 | 
 163 | The resource used for transfers
 164 | 
 165 | [account\_transfer\_resource!(dsl\_or\_extended)](AshDoubleEntry.Account.Info.html#account_transfer_resource!/1)
 166 | 
 167 | The resource used for transfers
 168 | 
 169 | # [](AshDoubleEntry.Account.Info.html#functions)Functions
 170 | 
 171 | [](AshDoubleEntry.Account.Info.html#account_balance_resource/1)
 172 | 
 173 | # account\_balance\_resource(dsl\_or\_extended)
 174 | 
 175 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 176 | 
 177 | ```
 178 | @spec account_balance_resource(dsl_or_extended :: module() | map()) ::
 179 |   {:ok, module()} | :error
 180 | ```
 181 | 
 182 | The resource used for balances
 183 | 
 184 | [](AshDoubleEntry.Account.Info.html#account_balance_resource!/1)
 185 | 
 186 | # account\_balance\_resource!(dsl\_or\_extended)
 187 | 
 188 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 189 | 
 190 | ```
 191 | @spec account_balance_resource!(dsl_or_extended :: module() | map()) ::
 192 |   module() | no_return()
 193 | ```
 194 | 
 195 | The resource used for balances
 196 | 
 197 | [](AshDoubleEntry.Account.Info.html#account_open_action_accept/1)
 198 | 
 199 | # account\_open\_action\_accept(dsl\_or\_extended)
 200 | 
 201 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 202 | 
 203 | ```
 204 | @spec account_open_action_accept(dsl_or_extended :: module() | map()) ::
 205 |   {:ok, [atom()]} | :error
 206 | ```
 207 | 
 208 | A list of extra attributes to be accepted by the open action. The `identifier` and `currency` attributes are always accepted.
 209 | 
 210 | [](AshDoubleEntry.Account.Info.html#account_open_action_accept!/1)
 211 | 
 212 | # account\_open\_action\_accept!(dsl\_or\_extended)
 213 | 
 214 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 215 | 
 216 | ```
 217 | @spec account_open_action_accept!(dsl_or_extended :: module() | map()) ::
 218 |   [atom()] | no_return()
 219 | ```
 220 | 
 221 | A list of extra attributes to be accepted by the open action. The `identifier` and `currency` attributes are always accepted.
 222 | 
 223 | [](AshDoubleEntry.Account.Info.html#account_options/1)
 224 | 
 225 | # account\_options(dsl\_or\_extended)
 226 | 
 227 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 228 | 
 229 | ```
 230 | @spec account_options(dsl_or_extended :: module() | map()) :: %{
 231 |   required(atom()) => any()
 232 | }
 233 | ```
 234 | 
 235 | account DSL options
 236 | 
 237 | Returns a map containing the and any configured or default values.
 238 | 
 239 | [](AshDoubleEntry.Account.Info.html#account_pre_check_identities_with/1)
 240 | 
 241 | # account\_pre\_check\_identities\_with(dsl\_or\_extended)
 242 | 
 243 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 244 | 
 245 | ```
 246 | @spec account_pre_check_identities_with(dsl_or_extended :: module() | map()) ::
 247 |   {:ok, module()} | :error
 248 | ```
 249 | 
 250 | A domain to use to precheck generated identities. Required by certain data layers.
 251 | 
 252 | [](AshDoubleEntry.Account.Info.html#account_pre_check_identities_with!/1)
 253 | 
 254 | # account\_pre\_check\_identities\_with!(dsl\_or\_extended)
 255 | 
 256 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 257 | 
 258 | ```
 259 | @spec account_pre_check_identities_with!(dsl_or_extended :: module() | map()) ::
 260 |   module() | no_return()
 261 | ```
 262 | 
 263 | A domain to use to precheck generated identities. Required by certain data layers.
 264 | 
 265 | [](AshDoubleEntry.Account.Info.html#account_transfer_resource/1)
 266 | 
 267 | # account\_transfer\_resource(dsl\_or\_extended)
 268 | 
 269 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 270 | 
 271 | ```
 272 | @spec account_transfer_resource(dsl_or_extended :: module() | map()) ::
 273 |   {:ok, module()} | :error
 274 | ```
 275 | 
 276 | The resource used for transfers
 277 | 
 278 | [](AshDoubleEntry.Account.Info.html#account_transfer_resource!/1)
 279 | 
 280 | # account\_transfer\_resource!(dsl\_or\_extended)
 281 | 
 282 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/account/info.ex#L3)
 283 | 
 284 | ```
 285 | @spec account_transfer_resource!(dsl_or_extended :: module() | map()) ::
 286 |   module() | no_return()
 287 | ```
 288 | 
 289 | The resource used for transfers
 290 | 
 291 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 292 | 
 293 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 294 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
 295 | 
 296 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
 297 | 
 298 | v1.0.10
 299 | 
 300 | - Pages
 301 | - Modules
 302 | - Mix Tasks
 303 | 
 304 | <!--THE END-->
 305 | 
 306 | <!--THE END-->
 307 | 
 308 | <!--THE END-->
 309 | 
 310 | Search documentation of ash\_double\_entry
 311 | 
 312 | Settings
 313 | 
 314 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/balance.ex#L1 "View Source") AshDoubleEntry.Balance (ash\_double\_entry v1.0.10)
 315 | 
 316 | An extension for creating a double entry ledger balance. See the getting started guide for more.
 317 | 
 318 | # [](AshDoubleEntry.Balance.html#summary)Summary
 319 | 
 320 | ## [Functions](AshDoubleEntry.Balance.html#functions)
 321 | 
 322 | [balance(body)](AshDoubleEntry.Balance.html#balance/1)
 323 | 
 324 | # [](AshDoubleEntry.Balance.html#functions)Functions
 325 | 
 326 | [](AshDoubleEntry.Balance.html#balance/1)
 327 | 
 328 | # balance(body)
 329 | 
 330 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/balance.ex#L42)(macro)
 331 | 
 332 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 333 | 
 334 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 335 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
 336 | 
 337 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
 338 | 
 339 | v1.0.10
 340 | 
 341 | - Pages
 342 | - Modules
 343 | - Mix Tasks
 344 | 
 345 | <!--THE END-->
 346 | 
 347 | <!--THE END-->
 348 | 
 349 | <!--THE END-->
 350 | 
 351 | Search documentation of ash\_double\_entry
 352 | 
 353 | Settings
 354 | 
 355 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L1 "View Source") AshDoubleEntry.Balance.Info (ash\_double\_entry v1.0.10)
 356 | 
 357 | Introspection helpers for [`AshDoubleEntry.Balance`](AshDoubleEntry.Balance.html)
 358 | 
 359 | # [](AshDoubleEntry.Balance.Info.html#summary)Summary
 360 | 
 361 | ## [Functions](AshDoubleEntry.Balance.Info.html#functions)
 362 | 
 363 | [balance\_account\_resource(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_account_resource/1)
 364 | 
 365 | The resource used for accounts
 366 | 
 367 | [balance\_account\_resource!(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_account_resource!/1)
 368 | 
 369 | The resource used for accounts
 370 | 
 371 | [balance\_data\_layer\_can\_add\_money?(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_data_layer_can_add_money?/1)
 372 | 
 373 | Whether or not the data layer supports adding money.
 374 | 
 375 | [balance\_money\_composite\_type?(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_money_composite_type?/1)
 376 | 
 377 | Whether the balance is stored as a composite type.
 378 | 
 379 | [balance\_options(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_options/1)
 380 | 
 381 | balance DSL options
 382 | 
 383 | [balance\_pre\_check\_identities\_with(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_pre_check_identities_with/1)
 384 | 
 385 | A domain to use to precheck generated identities. Required by certain data layers.
 386 | 
 387 | [balance\_pre\_check\_identities\_with!(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_pre_check_identities_with!/1)
 388 | 
 389 | A domain to use to precheck generated identities. Required by certain data layers.
 390 | 
 391 | [balance\_transfer\_resource(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_transfer_resource/1)
 392 | 
 393 | The resource used for transfers
 394 | 
 395 | [balance\_transfer\_resource!(dsl\_or\_extended)](AshDoubleEntry.Balance.Info.html#balance_transfer_resource!/1)
 396 | 
 397 | The resource used for transfers
 398 | 
 399 | # [](AshDoubleEntry.Balance.Info.html#functions)Functions
 400 | 
 401 | [](AshDoubleEntry.Balance.Info.html#balance_account_resource/1)
 402 | 
 403 | # balance\_account\_resource(dsl\_or\_extended)
 404 | 
 405 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 406 | 
 407 | ```
 408 | @spec balance_account_resource(dsl_or_extended :: module() | map()) ::
 409 |   {:ok, module()} | :error
 410 | ```
 411 | 
 412 | The resource used for accounts
 413 | 
 414 | [](AshDoubleEntry.Balance.Info.html#balance_account_resource!/1)
 415 | 
 416 | # balance\_account\_resource!(dsl\_or\_extended)
 417 | 
 418 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 419 | 
 420 | ```
 421 | @spec balance_account_resource!(dsl_or_extended :: module() | map()) ::
 422 |   module() | no_return()
 423 | ```
 424 | 
 425 | The resource used for accounts
 426 | 
 427 | [](AshDoubleEntry.Balance.Info.html#balance_data_layer_can_add_money?/1)
 428 | 
 429 | # balance\_data\_layer\_can\_add\_money?(dsl\_or\_extended)
 430 | 
 431 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 432 | 
 433 | ```
 434 | @spec balance_data_layer_can_add_money?(dsl_or_extended :: module() | map()) ::
 435 |   boolean()
 436 | ```
 437 | 
 438 | Whether or not the data layer supports adding money.
 439 | 
 440 | [](AshDoubleEntry.Balance.Info.html#balance_money_composite_type?/1)
 441 | 
 442 | # balance\_money\_composite\_type?(dsl\_or\_extended)
 443 | 
 444 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 445 | 
 446 | ```
 447 | @spec balance_money_composite_type?(dsl_or_extended :: module() | map()) :: boolean()
 448 | ```
 449 | 
 450 | Whether the balance is stored as a composite type.
 451 | 
 452 | [](AshDoubleEntry.Balance.Info.html#balance_options/1)
 453 | 
 454 | # balance\_options(dsl\_or\_extended)
 455 | 
 456 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 457 | 
 458 | ```
 459 | @spec balance_options(dsl_or_extended :: module() | map()) :: %{
 460 |   required(atom()) => any()
 461 | }
 462 | ```
 463 | 
 464 | balance DSL options
 465 | 
 466 | Returns a map containing the and any configured or default values.
 467 | 
 468 | [](AshDoubleEntry.Balance.Info.html#balance_pre_check_identities_with/1)
 469 | 
 470 | # balance\_pre\_check\_identities\_with(dsl\_or\_extended)
 471 | 
 472 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 473 | 
 474 | ```
 475 | @spec balance_pre_check_identities_with(dsl_or_extended :: module() | map()) ::
 476 |   {:ok, module()} | :error
 477 | ```
 478 | 
 479 | A domain to use to precheck generated identities. Required by certain data layers.
 480 | 
 481 | [](AshDoubleEntry.Balance.Info.html#balance_pre_check_identities_with!/1)
 482 | 
 483 | # balance\_pre\_check\_identities\_with!(dsl\_or\_extended)
 484 | 
 485 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 486 | 
 487 | ```
 488 | @spec balance_pre_check_identities_with!(dsl_or_extended :: module() | map()) ::
 489 |   module() | no_return()
 490 | ```
 491 | 
 492 | A domain to use to precheck generated identities. Required by certain data layers.
 493 | 
 494 | [](AshDoubleEntry.Balance.Info.html#balance_transfer_resource/1)
 495 | 
 496 | # balance\_transfer\_resource(dsl\_or\_extended)
 497 | 
 498 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 499 | 
 500 | ```
 501 | @spec balance_transfer_resource(dsl_or_extended :: module() | map()) ::
 502 |   {:ok, module()} | :error
 503 | ```
 504 | 
 505 | The resource used for transfers
 506 | 
 507 | [](AshDoubleEntry.Balance.Info.html#balance_transfer_resource!/1)
 508 | 
 509 | # balance\_transfer\_resource!(dsl\_or\_extended)
 510 | 
 511 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/balance/info.ex#L3)
 512 | 
 513 | ```
 514 | @spec balance_transfer_resource!(dsl_or_extended :: module() | map()) ::
 515 |   module() | no_return()
 516 | ```
 517 | 
 518 | The resource used for transfers
 519 | 
 520 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 521 | 
 522 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 523 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
 524 | 
 525 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
 526 | 
 527 | v1.0.10
 528 | 
 529 | - Pages
 530 | - Modules
 531 | - Mix Tasks
 532 | 
 533 | <!--THE END-->
 534 | 
 535 | <!--THE END-->
 536 | 
 537 | <!--THE END-->
 538 | 
 539 | Search documentation of ash\_double\_entry
 540 | 
 541 | Settings
 542 | 
 543 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/transfer.ex#L1 "View Source") AshDoubleEntry.Transfer (ash\_double\_entry v1.0.10)
 544 | 
 545 | An extension for creating a double entry ledger transfer. See the getting started guide for more.
 546 | 
 547 | # [](AshDoubleEntry.Transfer.html#summary)Summary
 548 | 
 549 | ## [Functions](AshDoubleEntry.Transfer.html#functions)
 550 | 
 551 | [transfer(body)](AshDoubleEntry.Transfer.html#transfer/1)
 552 | 
 553 | # [](AshDoubleEntry.Transfer.html#functions)Functions
 554 | 
 555 | [](AshDoubleEntry.Transfer.html#transfer/1)
 556 | 
 557 | # transfer(body)
 558 | 
 559 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/transfer.ex#L42)(macro)
 560 | 
 561 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 562 | 
 563 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 564 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
 565 | 
 566 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
 567 | 
 568 | v1.0.10
 569 | 
 570 | - Pages
 571 | - Modules
 572 | - Mix Tasks
 573 | 
 574 | <!--THE END-->
 575 | 
 576 | <!--THE END-->
 577 | 
 578 | <!--THE END-->
 579 | 
 580 | Search documentation of ash\_double\_entry
 581 | 
 582 | Settings
 583 | 
 584 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L1 "View Source") AshDoubleEntry.Transfer.Info (ash\_double\_entry v1.0.10)
 585 | 
 586 | Introspection helpers for [`AshDoubleEntry.Transfer`](AshDoubleEntry.Transfer.html)
 587 | 
 588 | # [](AshDoubleEntry.Transfer.Info.html#summary)Summary
 589 | 
 590 | ## [Functions](AshDoubleEntry.Transfer.Info.html#functions)
 591 | 
 592 | [transfer\_account\_resource(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_account_resource/1)
 593 | 
 594 | The resource to use for account balances
 595 | 
 596 | [transfer\_account\_resource!(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_account_resource!/1)
 597 | 
 598 | The resource to use for account balances
 599 | 
 600 | [transfer\_balance\_resource(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_balance_resource/1)
 601 | 
 602 | The resource being used for balances
 603 | 
 604 | [transfer\_balance\_resource!(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_balance_resource!/1)
 605 | 
 606 | The resource being used for balances
 607 | 
 608 | [transfer\_create\_accept(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_create_accept/1)
 609 | 
 610 | Additional attributes to accept when creating a transfer
 611 | 
 612 | [transfer\_create\_accept!(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_create_accept!/1)
 613 | 
 614 | Additional attributes to accept when creating a transfer
 615 | 
 616 | [transfer\_destroy\_balances?(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_destroy_balances?/1)
 617 | 
 618 | Whether or not balances must be manually destroyed. See the getting started guide for more.
 619 | 
 620 | [transfer\_options(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_options/1)
 621 | 
 622 | transfer DSL options
 623 | 
 624 | [transfer\_pre\_check\_identities\_with(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_pre_check_identities_with/1)
 625 | 
 626 | A domain to use to precheck generated identities. Required by certain data layers.
 627 | 
 628 | [transfer\_pre\_check\_identities\_with!(dsl\_or\_extended)](AshDoubleEntry.Transfer.Info.html#transfer_pre_check_identities_with!/1)
 629 | 
 630 | A domain to use to precheck generated identities. Required by certain data layers.
 631 | 
 632 | # [](AshDoubleEntry.Transfer.Info.html#functions)Functions
 633 | 
 634 | [](AshDoubleEntry.Transfer.Info.html#transfer_account_resource/1)
 635 | 
 636 | # transfer\_account\_resource(dsl\_or\_extended)
 637 | 
 638 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 639 | 
 640 | ```
 641 | @spec transfer_account_resource(dsl_or_extended :: module() | map()) ::
 642 |   {:ok, module()} | :error
 643 | ```
 644 | 
 645 | The resource to use for account balances
 646 | 
 647 | [](AshDoubleEntry.Transfer.Info.html#transfer_account_resource!/1)
 648 | 
 649 | # transfer\_account\_resource!(dsl\_or\_extended)
 650 | 
 651 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 652 | 
 653 | ```
 654 | @spec transfer_account_resource!(dsl_or_extended :: module() | map()) ::
 655 |   module() | no_return()
 656 | ```
 657 | 
 658 | The resource to use for account balances
 659 | 
 660 | [](AshDoubleEntry.Transfer.Info.html#transfer_balance_resource/1)
 661 | 
 662 | # transfer\_balance\_resource(dsl\_or\_extended)
 663 | 
 664 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 665 | 
 666 | ```
 667 | @spec transfer_balance_resource(dsl_or_extended :: module() | map()) ::
 668 |   {:ok, module()} | :error
 669 | ```
 670 | 
 671 | The resource being used for balances
 672 | 
 673 | [](AshDoubleEntry.Transfer.Info.html#transfer_balance_resource!/1)
 674 | 
 675 | # transfer\_balance\_resource!(dsl\_or\_extended)
 676 | 
 677 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 678 | 
 679 | ```
 680 | @spec transfer_balance_resource!(dsl_or_extended :: module() | map()) ::
 681 |   module() | no_return()
 682 | ```
 683 | 
 684 | The resource being used for balances
 685 | 
 686 | [](AshDoubleEntry.Transfer.Info.html#transfer_create_accept/1)
 687 | 
 688 | # transfer\_create\_accept(dsl\_or\_extended)
 689 | 
 690 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 691 | 
 692 | ```
 693 | @spec transfer_create_accept(dsl_or_extended :: module() | map()) ::
 694 |   {:ok, [atom()]} | :error
 695 | ```
 696 | 
 697 | Additional attributes to accept when creating a transfer
 698 | 
 699 | [](AshDoubleEntry.Transfer.Info.html#transfer_create_accept!/1)
 700 | 
 701 | # transfer\_create\_accept!(dsl\_or\_extended)
 702 | 
 703 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 704 | 
 705 | ```
 706 | @spec transfer_create_accept!(dsl_or_extended :: module() | map()) ::
 707 |   [atom()] | no_return()
 708 | ```
 709 | 
 710 | Additional attributes to accept when creating a transfer
 711 | 
 712 | [](AshDoubleEntry.Transfer.Info.html#transfer_destroy_balances?/1)
 713 | 
 714 | # transfer\_destroy\_balances?(dsl\_or\_extended)
 715 | 
 716 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 717 | 
 718 | ```
 719 | @spec transfer_destroy_balances?(dsl_or_extended :: module() | map()) :: boolean()
 720 | ```
 721 | 
 722 | Whether or not balances must be manually destroyed. See the getting started guide for more.
 723 | 
 724 | [](AshDoubleEntry.Transfer.Info.html#transfer_options/1)
 725 | 
 726 | # transfer\_options(dsl\_or\_extended)
 727 | 
 728 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 729 | 
 730 | ```
 731 | @spec transfer_options(dsl_or_extended :: module() | map()) :: %{
 732 |   required(atom()) => any()
 733 | }
 734 | ```
 735 | 
 736 | transfer DSL options
 737 | 
 738 | Returns a map containing the and any configured or default values.
 739 | 
 740 | [](AshDoubleEntry.Transfer.Info.html#transfer_pre_check_identities_with/1)
 741 | 
 742 | # transfer\_pre\_check\_identities\_with(dsl\_or\_extended)
 743 | 
 744 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 745 | 
 746 | ```
 747 | @spec transfer_pre_check_identities_with(dsl_or_extended :: module() | map()) ::
 748 |   {:ok, module()} | :error
 749 | ```
 750 | 
 751 | A domain to use to precheck generated identities. Required by certain data layers.
 752 | 
 753 | [](AshDoubleEntry.Transfer.Info.html#transfer_pre_check_identities_with!/1)
 754 | 
 755 | # transfer\_pre\_check\_identities\_with!(dsl\_or\_extended)
 756 | 
 757 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/transfer/info.ex#L3)
 758 | 
 759 | ```
 760 | @spec transfer_pre_check_identities_with!(dsl_or_extended :: module() | map()) ::
 761 |   module() | no_return()
 762 | ```
 763 | 
 764 | A domain to use to precheck generated identities. Required by certain data layers.
 765 | 
 766 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 767 | 
 768 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 769 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
 770 | 
 771 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
 772 | 
 773 | v1.0.10
 774 | 
 775 | - Pages
 776 | - Modules
 777 | - Mix Tasks
 778 | 
 779 | <!--THE END-->
 780 | 
 781 | <!--THE END-->
 782 | 
 783 | <!--THE END-->
 784 | 
 785 | Search documentation of ash\_double\_entry
 786 | 
 787 | Settings
 788 | 
 789 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L1 "View Source") AshDoubleEntry.ULID (ash\_double\_entry v1.0.10)
 790 | 
 791 | An Ash type for ULID strings.
 792 | 
 793 | # [](AshDoubleEntry.ULID.html#summary)Summary
 794 | 
 795 | ## [Types](AshDoubleEntry.ULID.html#types)
 796 | 
 797 | [t()](AshDoubleEntry.ULID.html#t:t/0)
 798 | 
 799 | A hex-encoded ULID string.
 800 | 
 801 | ## [Functions](AshDoubleEntry.ULID.html#functions)
 802 | 
 803 | [bingenerate(timestamp \\\\ System.system\_time(:millisecond))](AshDoubleEntry.ULID.html#bingenerate/1)
 804 | 
 805 | Generates a binary ULID.
 806 | 
 807 | [bingenerate\_last(timestamp \\\\ System.system\_time(:millisecond))](AshDoubleEntry.ULID.html#bingenerate_last/1)
 808 | 
 809 | Generates a binary ULID.
 810 | 
 811 | [cast\_input(value, constraints)](AshDoubleEntry.ULID.html#cast_input/2)
 812 | 
 813 | Casts a string to ULID.
 814 | 
 815 | [cast\_stored(bytes, constraints)](AshDoubleEntry.ULID.html#cast_stored/2)
 816 | 
 817 | Converts a binary ULID into a Crockford Base32 encoded string.
 818 | 
 819 | [dump\_to\_native(encoded, \_)](AshDoubleEntry.ULID.html#dump_to_native/2)
 820 | 
 821 | Converts a Crockford Base32 encoded ULID into a binary.
 822 | 
 823 | [generate(timestamp \\\\ System.system\_time(:millisecond))](AshDoubleEntry.ULID.html#generate/1)
 824 | 
 825 | Generates a Crockford Base32 encoded ULID.
 826 | 
 827 | [generate\_last(timestamp \\\\ System.system\_time(:millisecond))](AshDoubleEntry.ULID.html#generate_last/1)
 828 | 
 829 | Generates a Crockford Base32 encoded ULID, guaranteed to sort equal to or after any other ULID generated for the same timestamp.
 830 | 
 831 | [handle\_change?()](AshDoubleEntry.ULID.html#handle_change?/0)
 832 | 
 833 | [prepare\_change?()](AshDoubleEntry.ULID.html#prepare_change?/0)
 834 | 
 835 | [storage\_type()](AshDoubleEntry.ULID.html#storage_type/0)
 836 | 
 837 | The underlying schema type.
 838 | 
 839 | # [](AshDoubleEntry.ULID.html#types)Types
 840 | 
 841 | [](AshDoubleEntry.ULID.html#t:t/0)
 842 | 
 843 | # t()
 844 | 
 845 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L11)
 846 | 
 847 | ```
 848 | @type t() :: <<_::208>>
 849 | ```
 850 | 
 851 | A hex-encoded ULID string.
 852 | 
 853 | # [](AshDoubleEntry.ULID.html#functions)Functions
 854 | 
 855 | [](AshDoubleEntry.ULID.html#bingenerate/1)
 856 | 
 857 | # bingenerate(timestamp \\\\ System.system\_time(:millisecond))
 858 | 
 859 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L118)
 860 | 
 861 | Generates a binary ULID.
 862 | 
 863 | If a value is provided for `timestamp`, the generated ULID will be for the provided timestamp. Otherwise, a ULID will be generated for the current time.
 864 | 
 865 | Arguments:
 866 | 
 867 | - `timestamp`: A Unix timestamp with millisecond precision.
 868 | 
 869 | [](AshDoubleEntry.ULID.html#bingenerate_last/1)
 870 | 
 871 | # bingenerate\_last(timestamp \\\\ System.system\_time(:millisecond))
 872 | 
 873 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L134)
 874 | 
 875 | Generates a binary ULID.
 876 | 
 877 | Do not use this for storage, only for generating comparators, i.e "balance as of a given ulid".
 878 | 
 879 | If a value is provided for `timestamp`, the generated ULID will be for the provided timestamp. Otherwise, a ULID will be generated for the current time.
 880 | 
 881 | Arguments:
 882 | 
 883 | - `timestamp`: A Unix timestamp with millisecond precision.
 884 | 
 885 | [](AshDoubleEntry.ULID.html#cast_input/2)
 886 | 
 887 | # cast\_input(value, constraints)
 888 | 
 889 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L21)
 890 | 
 891 | Casts a string to ULID.
 892 | 
 893 | [](AshDoubleEntry.ULID.html#cast_stored/2)
 894 | 
 895 | # cast\_stored(bytes, constraints)
 896 | 
 897 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L50)
 898 | 
 899 | Converts a binary ULID into a Crockford Base32 encoded string.
 900 | 
 901 | [](AshDoubleEntry.ULID.html#dump_to_native/2)
 902 | 
 903 | # dump\_to\_native(encoded, \_)
 904 | 
 905 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L43)
 906 | 
 907 | Converts a Crockford Base32 encoded ULID into a binary.
 908 | 
 909 | [](AshDoubleEntry.ULID.html#generate/1)
 910 | 
 911 | # generate(timestamp \\\\ System.system\_time(:millisecond))
 912 | 
 913 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L70)
 914 | 
 915 | Generates a Crockford Base32 encoded ULID.
 916 | 
 917 | If a value is provided for `timestamp`, the generated ULID will be for the provided timestamp. Otherwise, a ULID will be generated for the current time.
 918 | 
 919 | Arguments:
 920 | 
 921 | - `timestamp`: A Unix timestamp with millisecond precision.
 922 | 
 923 | [](AshDoubleEntry.ULID.html#generate_last/1)
 924 | 
 925 | # generate\_last(timestamp \\\\ System.system\_time(:millisecond))
 926 | 
 927 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L95)
 928 | 
 929 | Generates a Crockford Base32 encoded ULID, guaranteed to sort equal to or after any other ULID generated for the same timestamp.
 930 | 
 931 | Do not use this for storage, only for generating comparators, i.e "balance as of a given ulid".
 932 | 
 933 | If a value is provided for `timestamp`, the generated ULID will be for the provided timestamp. Otherwise, a ULID will be generated for the current time.
 934 | 
 935 | Arguments:
 936 | 
 937 | - `timestamp`: A Unix timestamp with millisecond precision.
 938 | 
 939 | [](AshDoubleEntry.ULID.html#handle_change?/0)
 940 | 
 941 | # handle\_change?()
 942 | 
 943 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L1)
 944 | 
 945 | [](AshDoubleEntry.ULID.html#prepare_change?/0)
 946 | 
 947 | # prepare\_change?()
 948 | 
 949 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L1)
 950 | 
 951 | [](AshDoubleEntry.ULID.html#storage_type/0)
 952 | 
 953 | # storage\_type()
 954 | 
 955 | [](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/ulid.ex#L16)
 956 | 
 957 | The underlying schema type.
 958 | 
 959 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 960 | 
 961 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 962 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
 963 | 
 964 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
 965 | 
 966 | v1.0.10
 967 | 
 968 | - Pages
 969 | - Modules
 970 | - Mix Tasks
 971 | 
 972 | <!--THE END-->
 973 | 
 974 | <!--THE END-->
 975 | 
 976 | <!--THE END-->
 977 | 
 978 | Search documentation of ash\_double\_entry
 979 | 
 980 | Settings
 981 | 
 982 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/documentation/dsls/DSL-AshDoubleEntry.Account.md#L1 "View Source") AshDoubleEntry.Account
 983 | 
 984 | An extension for creating a double entry ledger account. See the getting started guide for more.
 985 | 
 986 | ## [](dsl-ashdoubleentry-account.html#account)account
 987 | 
 988 | ### [](dsl-ashdoubleentry-account.html#options)Options
 989 | 
 990 | NameTypeDefaultDocs[`transfer_resource`](dsl-ashdoubleentry-account.html#account-transfer_resource)`module`The resource used for transfers[`balance_resource`](dsl-ashdoubleentry-account.html#account-balance_resource)`module`The resource used for balances[`open_action_accept`](dsl-ashdoubleentry-account.html#account-open_action_accept)`list(atom)``[]`A list of extra attributes to be accepted by the open action. The `identifier` and `currency` attributes are always accepted.[`pre_check_identities_with`](dsl-ashdoubleentry-account.html#account-pre_check_identities_with)`module`A domain to use to precheck generated identities. Required by certain data layers.
 991 | 
 992 | [← Previous Page Get Started](getting-started-with-ash-double-entry.html)
 993 | 
 994 | [Next Page → AshDoubleEntry.Balance](dsl-ashdoubleentry-balance.html)
 995 | 
 996 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) ([current file](https://preview.hex.pm/preview/ash_double_entry/1.0.10/show/documentation/dsls/DSL-AshDoubleEntry.Account.md)) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
 997 | 
 998 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
 999 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
1000 | 
1001 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
1002 | 
1003 | v1.0.10
1004 | 
1005 | - Pages
1006 | - Modules
1007 | - Mix Tasks
1008 | 
1009 | <!--THE END-->
1010 | 
1011 | <!--THE END-->
1012 | 
1013 | <!--THE END-->
1014 | 
1015 | Search documentation of ash\_double\_entry
1016 | 
1017 | Settings
1018 | 
1019 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/documentation/dsls/DSL-AshDoubleEntry.Balance.md#L1 "View Source") AshDoubleEntry.Balance
1020 | 
1021 | An extension for creating a double entry ledger balance. See the getting started guide for more.
1022 | 
1023 | ## [](dsl-ashdoubleentry-balance.html#balance)balance
1024 | 
1025 | ### [](dsl-ashdoubleentry-balance.html#options)Options
1026 | 
1027 | NameTypeDefaultDocs[`transfer_resource`](dsl-ashdoubleentry-balance.html#balance-transfer_resource)`module`The resource used for transfers[`account_resource`](dsl-ashdoubleentry-balance.html#balance-account_resource)`module`The resource used for accounts[`pre_check_identities_with`](dsl-ashdoubleentry-balance.html#balance-pre_check_identities_with)`module`A domain to use to precheck generated identities. Required by certain data layers.[`money_composite_type?`](dsl-ashdoubleentry-balance.html#balance-money_composite_type?)`boolean``true`Whether the balance is stored as a composite type.[`data_layer_can_add_money?`](dsl-ashdoubleentry-balance.html#balance-data_layer_can_add_money?)`boolean``true`Whether or not the data layer supports adding money.
1028 | 
1029 | [← Previous Page AshDoubleEntry.Account](dsl-ashdoubleentry-account.html)
1030 | 
1031 | [Next Page → AshDoubleEntry.Transfer](dsl-ashdoubleentry-transfer.html)
1032 | 
1033 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) ([current file](https://preview.hex.pm/preview/ash_double_entry/1.0.10/show/documentation/dsls/DSL-AshDoubleEntry.Balance.md)) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
1034 | 
1035 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
1036 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
1037 | 
1038 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
1039 | 
1040 | v1.0.10
1041 | 
1042 | - Pages
1043 | - Modules
1044 | - Mix Tasks
1045 | 
1046 | <!--THE END-->
1047 | 
1048 | <!--THE END-->
1049 | 
1050 | <!--THE END-->
1051 | 
1052 | Search documentation of ash\_double\_entry
1053 | 
1054 | Settings
1055 | 
1056 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/documentation/dsls/DSL-AshDoubleEntry.Transfer.md#L1 "View Source") AshDoubleEntry.Transfer
1057 | 
1058 | An extension for creating a double entry ledger transfer. See the getting started guide for more.
1059 | 
1060 | ## [](dsl-ashdoubleentry-transfer.html#transfer)transfer
1061 | 
1062 | ### [](dsl-ashdoubleentry-transfer.html#options)Options
1063 | 
1064 | NameTypeDefaultDocs[`account_resource`](dsl-ashdoubleentry-transfer.html#transfer-account_resource)`module`The resource to use for account balances[`pre_check_identities_with`](dsl-ashdoubleentry-transfer.html#transfer-pre_check_identities_with)`module`A domain to use to precheck generated identities. Required by certain data layers.[`balance_resource`](dsl-ashdoubleentry-transfer.html#transfer-balance_resource)`module`The resource being used for balances[`create_accept`](dsl-ashdoubleentry-transfer.html#transfer-create_accept)`atom | list(atom)``[]`Additional attributes to accept when creating a transfer[`destroy_balances?`](dsl-ashdoubleentry-transfer.html#transfer-destroy_balances?)`boolean``false`Whether or not balances must be manually destroyed. See the getting started guide for more.
1065 | 
1066 | [← Previous Page AshDoubleEntry.Balance](dsl-ashdoubleentry-balance.html)
1067 | 
1068 | [Next Page → Change Log](changelog.html)
1069 | 
1070 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) ([current file](https://preview.hex.pm/preview/ash_double_entry/1.0.10/show/documentation/dsls/DSL-AshDoubleEntry.Transfer.md)) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
1071 | 
1072 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
1073 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
1074 | 
1075 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
1076 | 
1077 | v1.0.10
1078 | 
1079 | - Pages
1080 | - Modules
1081 | - Mix Tasks
1082 | 
1083 | <!--THE END-->
1084 | 
1085 | <!--THE END-->
1086 | 
1087 | <!--THE END-->
1088 | 
1089 | Search documentation of ash\_double\_entry
1090 | 
1091 | Settings
1092 | 
1093 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/documentation/tutorials/getting-started-with-ash-double-entry.md#L1 "View Source") Getting Started with Ash Double Entry
1094 | 
1095 | Ash Double Entry is implemented as a set of Ash resource extensions. You build the resources yourself, and the extensions add the attributes, relationships, actions and validations required for them to constitute a double entry system.
1096 | 
1097 | ## [](getting-started-with-ash-double-entry.html#what-makes-it-special)What makes it special?
1098 | 
1099 | 1. Account balances are updated automatically as transfers are introduced.
1100 | 2. Arbitrary custom validations and behavior by virtue of modifying your own resources.
1101 | 3. Transactions can be entered in the past, and all future balances are updated (and therefore validated).
1102 | 
1103 | ## [](getting-started-with-ash-double-entry.html#setup)Setup
1104 | 
1105 | ### [](getting-started-with-ash-double-entry.html#setup-ashmoney)Setup AshMoney
1106 | 
1107 | Follow the setup guide for [`AshMoney`](../ash_money/0.1.15/AshMoney.html). If you are using with `AshPostgres`, be sure to include the `:ex_money_sql` dependency in your `mix.exs`.
1108 | 
1109 | ### [](getting-started-with-ash-double-entry.html#add-the-dependency)Add the dependency
1110 | 
1111 | ```
1112 | {:ash_double_entry, "~> 1.0.3"}
1113 | ```
1114 | 
1115 | ### [](getting-started-with-ash-double-entry.html#define-your-account-resource)Define your account resource
1116 | 
1117 | #### Example
1118 | 
1119 | ```
1120 | defmodule YourApp.Ledger.Account do
1121 |   use Ash.Resource,
1122 |     domain: YourApp.Ledger,
1123 |     data_layer: AshPostgres.DataLayer,
1124 |     extensions: [AshDoubleEntry.Account]
1125 | 
1126 |   postgres do
1127 |     table "accounts"
1128 |     repo YourApp.Repo
1129 |   end
1130 | 
1131 |   account do
1132 |     # configure the other resources it will interact with
1133 |     transfer_resource YourApp.Ledger.Transfer
1134 |     balance_resource YourApp.Ledger.Balance
1135 |     # accept custom attributes in the autogenerated `open` create action
1136 |     open_action_accept [:account_number]
1137 |   end
1138 | 
1139 |   attributes do
1140 |     # Add custom attributes
1141 |     attribute :account_number, :string do
1142 |       allow_nil? false
1143 |     end
1144 |   end
1145 | end
1146 | ```
1147 | 
1148 | #### What does this extension do?
1149 | 
1150 | - Adds the following attributes:
1151 |   
1152 |   - `:id`, a `:uuid` primary key
1153 |   - `:currency`, a `:string` representing the currency of the account.
1154 |   - `:inserted_at`, a `:utc_datetime_usec` timestamp
1155 |   - `:identifier`, a `:string` and a unique identifier for the account
1156 | - Adds the following actions:
1157 |   
1158 |   - A primary read called `:read`, unless a primary read action already exists.
1159 |   - A create action called `open`, that accepts `identifier`, `currency`, and the attributes in `open_action_accept`
1160 |   - A read action called `:lock_accounts` that can be used to lock a list of accounts while in a transaction(for data layers that support it)
1161 | - Adds a `has_many` relationship called `balances`, referring to all related balances of an account
1162 | - Adds an aggregate called `balance`, referring to the latest balance as a `decimal` for that account
1163 | - Adds the following calculations:
1164 | - A `balance_as_of_ulid` calculation that takes an argument called `ulid`, which corresponds to a transfer id and returns the balance.
1165 | - A `balance_as_of` calculation that takes a `utc_datetime_usec` and returns the balance as of that datetime.
1166 | - Adds an identity called `unique_identifier` that ensures `identifier` is unique.
1167 | 
1168 | ### [](getting-started-with-ash-double-entry.html#define-your-transfer-resource)Define your transfer resource
1169 | 
1170 | #### Example
1171 | 
1172 | ```
1173 | defmodule YourApp.Ledger.Transfer do
1174 |   use Ash.Resource,
1175 |     domain: YourApp.Ledger,
1176 |     data_layer: AshPostgres.DataLayer,
1177 |     extensions: [AshDoubleEntry.Transfer]
1178 | 
1179 |   postgres do
1180 |     table "transfers"
1181 |     repo YourApp.Repo
1182 |   end
1183 | 
1184 |   transfer do
1185 |     # configure the other resources it will interact with
1186 |     account_resource YourApp.Ledger.Account
1187 |     balance_resource YourApp.Ledger.Balance
1188 | 
1189 |     # you only need this if you are using `postgres`
1190 |     # and so cannot add the `references` block shown below
1191 | 
1192 |     # destroy_balances? true
1193 |   end
1194 | end
1195 | ```
1196 | 
1197 | #### What does this extension do?
1198 | 
1199 | - Adds the following attributes
1200 |   
1201 |   - `:id`, a [`AshDoubleEntry.ULID`](AshDoubleEntry.ULID.html) primary key which is sortable based on the `timestamp` of the transfer.
1202 |   - `:amount`, a [`AshMoney.Types.Money`](../ash_money/0.1.15/AshMoney.Types.Money.html) representing the amount and currency of the transfer
1203 |   - `:timestamp`, a `:utc_datetime_usec` representing when the transfer occurred
1204 |   - `:inserted_at`, a `:utc_datetime_usec` timestamp
1205 | - Adds the following relationships
1206 |   
1207 |   - `:from_account`, a `belongs_to` relationship of the account the transfer is from
1208 |   - `:to_account`, a `belongs_to` relationship of the account the transfer is to
1209 | - Adds a `:read` action called `:read_transfers` with keyset pagination enabled. Required for streaming transfers, used for validating balances.
1210 | - Adds a change that runs on all create and update actions that reifies the balances table. It inserts a balance for the transfer, and updates any affected future balances.
1211 | 
1212 | ### [](getting-started-with-ash-double-entry.html#define-your-balance-resource)Define your balance resource
1213 | 
1214 | #### Example
1215 | 
1216 | ```
1217 | defmodule YourApp.Ledger.Balance do
1218 |   use Ash.Resource,
1219 |     domain: YourApp.Ledger,
1220 |     data_layer: AshPostgres.DataLayer,
1221 |     extensions: [AshDoubleEntry.Balance]
1222 | 
1223 |   postgres do
1224 |     table "balances"
1225 |     repo YourApp.Repo
1226 | 
1227 |     references do
1228 |       reference :transfer, on_delete: :delete
1229 |     end
1230 |   end
1231 | 
1232 |   balance do
1233 |     # configure the other resources it will interact with
1234 |     transfer_resource YourApp.Ledger.Transfer
1235 |     account_resource YourApp.Ledger.Account
1236 |   end
1237 | 
1238 |   actions do
1239 |     read :read do
1240 |       primary? true
1241 |       # configure keyset pagination for streaming
1242 |       pagination keyset?: true, required?: false
1243 |     end
1244 |   end
1245 | end
1246 | ```
1247 | 
1248 | ### [](getting-started-with-ash-double-entry.html#cascading-destroys)cascading destroys
1249 | 
1250 | If you are not using a data layer capable of automatic cascade deletion, you must add `destroy_balances? true` to the `transfer` resource! We do this with the `references` block in `ash_postgres` as shown above.
1251 | 
1252 | #### What does this extension do?
1253 | 
1254 | - Adds the following attributes:
1255 |   
1256 |   - `:id`, a `:uuid` primary key
1257 |   - `:balance`, the balance as a decimal of the account at the time of the related transfer
1258 | - Adds the following relationships:
1259 |   
1260 |   - `:transfer` a `:belongs_to` relationship, pointing to the transfer that this balance is as of.
1261 |   - `:account` a `:belongs_to` relationship, pointing to the account the balance is for
1262 | - Adds the following actions:
1263 |   
1264 |   - a primary read action called `:read`, if a priamry read action doesn't exist
1265 |   - configure primary read action to have keyset pagination enabled
1266 |   - a create action caleld `:upsert_balance`, which will create or update the relevant balance, by `transfer_id` and `account_id`
1267 | - Adds an identity that ensures that `account_id` and `transfer_id` are unique
1268 | 
1269 | ### [](getting-started-with-ash-double-entry.html#define-an-ash-domain-to-use-them-through)Define an Ash domain to use them through
1270 | 
1271 | ```
1272 | defmodule YourApp.Ledger do
1273 |   use Ash.Domain
1274 | 
1275 |   resources do
1276 |     resource YourApp.Ledger.Account
1277 |     resource YourApp.Ledger.Balance
1278 |     resource YourApp.Ledger.Transfer
1279 |   end
1280 | end
1281 | ```
1282 | 
1283 | And add the domain to your config
1284 | 
1285 | `config :your_app, ash_domains: [..., YourApp.Ledger]`
1286 | 
1287 | ### [](getting-started-with-ash-double-entry.html#generate-migrations)Generate Migrations
1288 | 
1289 | `mix ash_postgres.generate_migrations --name add_double_entry_ledger`
1290 | 
1291 | ### [](getting-started-with-ash-double-entry.html#run-them)Run them
1292 | 
1293 | `mix ash_postgres.migrate`
1294 | 
1295 | ### [](getting-started-with-ash-double-entry.html#use-them)Use them
1296 | 
1297 | #### Create an account
1298 | 
1299 | ```
1300 | YourApp.Ledger.Account
1301 | |> Ash.Changeset.for_create(:open, %{identifier: "account_one"})
1302 | |> YourApp.Ledger.create!()
1303 | ```
1304 | 
1305 | #### Create transfers between accounts
1306 | 
1307 | ```
1308 | YourApp.Ledger.Transfer
1309 | |> Ash.Changeset.for_create(:transfer, %{
1310 |   amount: Money.new!(20, :USD),
1311 |   from_account_id: account_one.id,
1312 |   to_account_id: account_two.id
1313 | })
1314 | |> YourApp.Ledger.create!()
1315 | ```
1316 | 
1317 | #### Check an account's balance
1318 | 
1319 | ```
1320 | YourApp.Ledger.Account
1321 | |> YourApp.Ledger.get!(account_id, load: :balance_as_of)
1322 | |> Map.get(:balance_as_of)
1323 | # => Money.new!(20, :USD)
1324 | ```
1325 | 
1326 | ## [](getting-started-with-ash-double-entry.html#what-else-can-you-do)What else can you do?
1327 | 
1328 | There are tons of things you can do with your resources. You can add code interfaces to give yourself a nice functional api. You can add custom attributes, aggregates, calculations, relationships, validations, changes, all the great things built into [`Ash.Resource`](../ash/3.4.56/Ash.Resource.html)! See the docs for more: [AshHq](https://ash-hq.org).
1329 | 
1330 | [← Previous Page Home](readme.html)
1331 | 
1332 | [Next Page → AshDoubleEntry.Account](dsl-ashdoubleentry-account.html)
1333 | 
1334 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) ([current file](https://preview.hex.pm/preview/ash_double_entry/1.0.10/show/documentation/tutorials/getting-started-with-ash-double-entry.md)) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
1335 | 
1336 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
1337 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
1338 | 
1339 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
1340 | 
1341 | v1.0.10
1342 | 
1343 | - Pages
1344 | - Modules
1345 | - Mix Tasks
1346 | 
1347 | <!--THE END-->
1348 | 
1349 | <!--THE END-->
1350 | 
1351 | <!--THE END-->
1352 | 
1353 | Search documentation of ash\_double\_entry
1354 | 
1355 | Settings
1356 | 
1357 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/lib/mix/tasks/ash_double_entry.install.ex#L26 "View Source") mix ash\_double\_entry.install (ash\_double\_entry v1.0.10)
1358 | 
1359 | Installs AshDoubleEntry
1360 | 
1361 | ## [](Mix.Tasks.AshDoubleEntry.Install.html#module-example)Example
1362 | 
1363 | ```
1364 | mix ash_double_entry.install --example arg
1365 | ```
1366 | 
1367 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
1368 | 
1369 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
1370 | [![ash_double_entry](assets/logo.png)](https://github.com/ash-project/ash_double_entry)
1371 | 
1372 | [ash\_double\_entry](https://github.com/ash-project/ash_double_entry)
1373 | 
1374 | v1.0.10
1375 | 
1376 | - Pages
1377 | - Modules
1378 | - Mix Tasks
1379 | 
1380 | <!--THE END-->
1381 | 
1382 | <!--THE END-->
1383 | 
1384 | <!--THE END-->
1385 | 
1386 | Search documentation of ash\_double\_entry
1387 | 
1388 | Settings
1389 | 
1390 | # [View Source](https://github.com/ash-project/ash_double_entry/blob/v1.0.10/README.md#L1 "View Source") Home
1391 | 
1392 | ![Logo](https://github.com/ash-project/ash/blob/main/logos/cropped-for-header-black-text.png?raw=true#gh-light-mode-only) ![Logo](https://github.com/ash-project/ash/blob/main/logos/cropped-for-header-white-text.png?raw=true#gh-dark-mode-only)
1393 | 
1394 | ![Elixir CI](https://github.com/ash-project/ash_double_entry/workflows/CI/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Hex version badge](https://img.shields.io/hexpm/v/ash_double_entry.svg)](https://hex.pm/packages/ash_double_entry) [![Hexdocs badge](https://img.shields.io/badge/docs-hexdocs-purple)](../ash_double_entry.html)
1395 | 
1396 | # AshDoubleEntry
1397 | 
1398 | Welcome! This is the extension for building a double entry accounting system in [Ash](../ash.html). This extension provides the basic building blocks for you to extend as necessary.
1399 | 
1400 | ## [](readme.html#tutorials)Tutorials
1401 | 
1402 | - [Getting Started with AshDoubleEntry](getting-started-with-ash-double-entry.html)
1403 | 
1404 | ## [](readme.html#reference)Reference
1405 | 
1406 | - [AshDoubleEntry.Account DSL](dsl-ashdoubleentry-account.html)
1407 | - [AshDoubleEntry.Transfer DSL](dsl-ashdoubleentry-transfer.html)
1408 | - [AshDoubleEntry.Balance DSL](dsl-ashdoubleentry-balance.html)
1409 | 
1410 | [← Previous Page API Reference](api-reference.html)
1411 | 
1412 | [Next Page → Get Started](getting-started-with-ash-double-entry.html)
1413 | 
1414 | [Hex Package](https://hex.pm/packages/ash_double_entry/1.0.10) [Hex Preview](https://preview.hex.pm/preview/ash_double_entry/1.0.10) ([current file](https://preview.hex.pm/preview/ash_double_entry/1.0.10/show/README.md)) Search HexDocs [Download ePub version](ash_double_entry.epub "ePub version")
1415 | 
1416 | Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.36.1) for the [Elixir programming language](https://elixir-lang.org "Elixir")
1417 | 
```
Page 2/10FirstPrevNextLast