Ash Framework
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.
JoinAsh Framework
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.
Join`AshJsonApi` composite primary key
AshJsonApi
to a project currently using AshGraphql
, getting complaints about my many_to_many
resources:
json_api -> primary_key:
AshJsonApi requires primary key when a resource has a composite key
json_api -> primary_key:
AshJsonApi requires primary key when a resource has a composite key
Auto forms silently drops some associations
_join
form. There were no errors, but not all of the resource associations were present. Looks like here https://github.com/ash-project/ash_phoenix/blob/main/lib/ash_phoenix/form/auto.ex#L469 we use Enum.find
, so we are only getting the first occurence of the association. I tried editing it to Enum.filter
and changing the type from :single
to :list
. This made the associations properly appear in the form, but submitting it failed.
Got me wondering a few things. First, maybe I screwed up somewhere before 😅 . Secondly for fixing it if it is a bug, it doesn't seem like we can know :single or :list beforehand , so would we need to use an anonymous function to resolve which similar to how data is resolved? type: :single,
data: &get_join(&1, &2, relationship),
type: :single,
data: &get_join(&1, &2, relationship),
:list
and handle the length = 1 case for single?...Embed `has_one` relationship into resource
Resource interactions
pending=false
, which is set through the update :cleared
action, I want to then add or subtract the amount on that transaction from the bank_account balance. See pseudo code in image attached for what I am envisioning....
Serialized access to instance of resource for `AshPostgres`
changes
hook to ensure that change actions to an instance (row) of a resource are serialized. For now I'm only looking at Postgres support, but if the lock
primitive comes into play, happy to update. Primary changes are the addition of a definitely-not-working locking statement and or changeset.type == :read
to not block read
actions.
```elixir
defmodule AshPostgresUtil.SerializedChanges do
defmacro using(opts \ []) do...Using manage_relationship with nested relationships
Does ash support multi tenancy with foreign key?
Loading related resource, filtered using a property on the Join Table
Help with contains case insensitive Query
this is my code read :by_title do...
`is_a` relationship type
is_a
relationship, meaning each row in the source resource matches one and exactly one row in the destination resource, and has a matching primary key. Perhaps there is already an idiom for this?Getting Started with Ash and Phoenix Blog question
entry MyAshPhoenixApp.Blog.Post
entry MyAshPhoenixApp.Blog.Post
Idiomatic way to create attribute-specific policies
Filter function do not work...What am I missing? (Returns empty)
Using `Ash.Type.String` like `Ash.Type.Enum`
lib/bookstore/types/isbn.ex
:
```elixir
defmodule Bookstore.Type.ISBN do...Cache layer to Ash rest api
Using args in policies
^arg(:attribute_name)
but doing so is not working for me. This is my resource.
```defmodule OpenBudget.Budgets.Transaction do
use Ash.Resource,
data_layer: AshPostgres.DataLayer,
authorizers: [Ash.Policy.Authorizer]...
Exdocs for Ash rest api
Multitenancy and different Liveviews
Passing validation arguments for the Form's underlying actions
AshPhoenix.Form.validate(socket.assigns.form, params)
If action :create requires user_id as an argument, is it simply passed by including it in the params
? like %{user_id: "12345"}...AshPhoenix.Form doesn't seem to respect phx-feedback-for