Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93ad7d1

Browse files
authored
docs: Update docs in readme (ash-project#50)
1 parent72afa96 commit93ad7d1

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

‎README.md‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,23 @@ First, ensure you've added ash_postgres to your `mix.exs` file.
2525
{:ash_postgres,"~> x.y.z"}
2626
```
2727

28-
To use this data layer, you need todefine an`Ecto.Repo`. AshPostgres adds some
29-
functionality on top of ecto repos, so you'll wanttouse`AshPostgres.Repo`
28+
To use this data layer, you need tochage yourEctoRepo's from`use Ecto.Repo`,
29+
to`use AshPostgres.Repo`. because AshPostgres adds functionalitytoEcto Repos.
3030

31-
Then, configure yourresource like so:
31+
Then, configureeach ofyour`Ash.Resource` resources by adding`use Ash.Resource, data_layer: AshPostgres.DataLayer` like so:
3232

3333
```elixir
34-
postgresdo
35-
repoMyApp.Repo
36-
table"table_name"
34+
defmoduleMyApp.SomeResourcedo
35+
useAsh.Resource,data_layer:AshPostgres.DataLayer
36+
37+
postgresdo
38+
repoMyApp.Repo
39+
table"table_name"
40+
end
41+
42+
attributesdo
43+
# ... Attribute definitions
44+
end
3745
end
3846
```
3947

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp