zenchild
Ash.DataLayer.Mnesia - table name
I’m playing around with the Mnesia datalayer while I’m going through the Ash book. I wanted to give it a go instead of the postgresql datalayer. I’m setting an explicit table name (:artists), but it still wants to use the module name as the table. Am I configuring it wrong? Here’s my resource module:
defmodule AshMnesia.Music.Artist do
use Ash.Resource,
otp_app: :ash_mnesia,
domain: AshMnesia.Music,
data_layer: Ash.DataLayer.Mnesia
mnesia do
table :artists
end
actions do
defaults [:read, :destroy]
create :create do
accept [:name]
end
update :update do
accept [:name]
end
end
attributes do
uuid_v7_primary_key :id
attribute :name, :string do
allow_nil? false
end
end
end
Even though I’m explicitly specifying a table, the below still is using an mnesia table called AshMnesia.Music.Artist.
> AshMnesia.Music.Artist |> Ash.Changeset.for_create(:create, %{name: "Daisy Jones"}) |> Ash.create
Thanks for any help anyone can give. ![]()
Marked As Solved
zachdaniel
Fixed in main of ash. With a commit aptly entitled
fix: actually use the mnesia table configured
Last Post!
zenchild
Thanks @zachdaniel! I just started digging into the code and cloned the repo to fix it and noticed you already did ![]()
Much appreciated!
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









