docs: update version, add example usage, fix DSL example (#8)

This commit is contained in:
Lars Heinrichs 2024-07-29 12:57:32 +01:00 committed by GitHub
parent 2f00b5d3f4
commit 6ae2f85d0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 3 deletions

View file

@ -7,7 +7,21 @@ AshCsv offers basic support for storing and reading resources from csv files.
Add `ash_csv` to your list of dependencies in `mix.exs`:
```elixir
{:ash_csv, "~> 0.9.7-rc.0"}
{:ash_csv, "~> 0.9.7"}
```
For information on how to configure it, see the [DSL documentation.](/documentation/dsls/DSL:-AshCsv.DataLayer.md)
## Usage
```
defmodule MyApp.MyResource do
use Ash.Resource,
domain: MyApp,
data_layer: AshCsv.DataLayer
csv do
... # see configuration options below
end
end
```
For information on how to configure ash_csv, see the [DSL documentation.](/documentation/dsls/DSL:-AshCsv.DataLayer.md)

View file

@ -32,7 +32,7 @@ defmodule AshCsv.DataLayer do
file "priv/data/tags.csv"
create? true
header? true
separator '-'
separator ?;
columns [:id, :name]
end
"""