ash_cubdb/documentation/dsls/DSL:-AshCubDB.DataLayer.cheatmd
James Harton 83ff64f256
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
docs: regenerate Spark DSL cheatsheets.
2023-09-30 10:11:17 +13:00

226 lines
4.8 KiB
Plaintext

<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshCubDB.DataLayer
A CubDB data layer for Ash.
<!--- ash-hq-hide-start --> <!--- -->
## DSL Documentation
### Index
* cubdb
### Docs
## cubdb
CubDB data layer configuration.
Examples:
```
cubdb do
directory "/opt/storage/my_awesome_resource"
auto_compact? true
auto_file_sync? true
name :my_awesome_resource
end
```
---
* `:directory` - 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` (`t:atom/0`) - 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` will be called for the resource.
* `:auto_compact?` (`t:boolean/0`) - 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. The default value is `true`.
* `:auto_file_sync?` (`t:boolean/0`) - 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) The default value is `true`.
* `:name` (`t:atom/0`) - 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.
<!--- ash-hq-hide-stop --> <!--- -->
## cubdb
CubDB data layer configuration.
### Examples
```
cubdb do
directory "/opt/storage/my_awesome_resource"
auto_compact? true
auto_file_sync? true
name :my_awesome_resource
end
```
### Options
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th colspan=2>Docs</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">
<a id="cubdb-directory" href="#cubdb-directory">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
directory
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">nil | String.t</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
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.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="cubdb-otp_app" href="#cubdb-otp_app">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
otp_app
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">atom</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
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` will be called for the resource.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="cubdb-auto_compact?" href="#cubdb-auto_compact?">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
auto_compact?
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">boolean</code>
</td>
<td style="text-align: left">
<code class="inline">true</code>
</td>
<td style="text-align: left" colspan=2>
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.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="cubdb-auto_file_sync?" href="#cubdb-auto_file_sync?">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
auto_file_sync?
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">boolean</code>
</td>
<td style="text-align: left">
<code class="inline">true</code>
</td>
<td style="text-align: left" colspan=2>
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)
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="cubdb-name" href="#cubdb-name">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
name
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">atom</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
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.
</td>
</tr>
</tbody>
</table>