mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
65f93561d8
- bulk_create returns a Postgrex error instead of Ash.Error.Changes.Required like the non-bulk create does - bulk_update with :stream strategy does the same - bulk_update with :atomic strategy doesn't trim the empty string and writes it to the database
39 lines
696 B
Elixir
39 lines
696 B
Elixir
defmodule AshPostgres.Test.Record do
|
|
@moduledoc false
|
|
|
|
use Ash.Resource,
|
|
domain: AshPostgres.Test.Domain,
|
|
data_layer: AshPostgres.DataLayer
|
|
|
|
attributes do
|
|
uuid_primary_key(:id)
|
|
|
|
attribute(:full_name, :string, allow_nil?: false, public?: true)
|
|
|
|
timestamps(public?: true)
|
|
end
|
|
|
|
relationships do
|
|
alias AshPostgres.Test.Entity
|
|
|
|
has_one :entity, Entity do
|
|
public?(true)
|
|
no_attributes?(true)
|
|
|
|
read_action(:read_from_temp)
|
|
|
|
filter(expr(full_name == parent(full_name)))
|
|
end
|
|
end
|
|
|
|
postgres do
|
|
table "records"
|
|
repo AshPostgres.TestRepo
|
|
end
|
|
|
|
actions do
|
|
default_accept(:*)
|
|
|
|
defaults([:create, :read, :update])
|
|
end
|
|
end
|