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.
JoinBest Practices: Code Interfaces vs Resource Actions
Ash.DataLayer.Simple with AshJsonApi.Resource
search route work that returns one or more Resources with data layer Ash.DataLayer.Simple?Working with large integer values in AshJsonApi
:integer in the Ash resource, AshJsonApi is returning them as a number type in the JSON responses that is getting truncated due to the length of the values. For example, a value like 953764064726843398 would get truncated to 953764064726843400 (notice how the 3 least significant digits changed).
The way I've worked around this in other stacks is by treating them as a string value instead. I would like to do the same here, but I don't know if there's a straightforward way to achieve that using AshJsonApi . I basically want them to be parsed to and from a string while keeping the DB column as an integer, preferably without having to change the Ash resource attribute to a :string since that would affect more than just the exposed JSON:API....AshJsonApi relationship fields
hardware resource which has a belongs_to: :system relationship with a system resource which is on a different domain, and I would like to fetch the hardware with its system with specific fields. If I use the following value for the fields parameter, the attributes in the response include the system with the default_fields defined for that resource, which is expected:
```json...Error "Module must be purged before deleting" after updating dependencies
mix format command prints out all these errors?
```elixir
09:36:18.362 [error] Module 'Elixir.Phoenix.HTML.Safe' must be purged before deleting
09:36:18.362 [error] Module 'Elixir.Phoenix.HTML.Safe' must be purged before deleting...How to prevent running underlying datalayer behaviour on delete? `set_result/2` isn't working.
Changeset.set_results/2 for destroy actions?
The set_result is runing the underlying datalayer behavior on delete, but according to the documentation, it should not happen. https://hexdocs.pm/ash/Ash.Changeset.html#set_result/2
What am I missing?..._build and tests started passing.
https://github.com/ash-project/ash/issues/2424...unselected attribute used in relationship filter + aggregate results in column does not exist error
children relationship that looks like this (level is the ltree column, and nlevel is a calculation that is just nlevel(level)):
```elixir...ash_graphql update without authorizing the read action
Ash is not triggering `before_action` hook callback function when updates are atomic
Referencing action argument in policy
create action where the argument is an instance of my Maps.Map struct, like so
```
create :add_to_map do
accept [:name]
...Problem in using manage_relationship and Ash events with tenant
"Bug" with Ash.Seed.upsert on attribute multitenancy with identities.
identity :unique_name [:name] on an attribute multitenant app. The migration is well generated and creates a unique_index on [:tenant_id, :name]. But when using upsert on Seed, when I specify identity: :unique_name it does not include the tenant_id which fails with error ERROR 42P10 (invalid_column_reference) there is no unique or exclusion constraint matching the ON CONFLICT specification.
The current fix is to change my identity to identity :unique_name [:tenant_id, :name]. Is this what should be expected when difining unique_indexes in multi-tenant apps?...Adding an association in an action based on argument
Maps.Map and Pin , where a Pin belongs to a Map. I want to pass an existing Map to the Pin as part of the create action. like so
```
usage (via code interface)...Using an inline aggregate of unrelated resource filtering by related resources
Correct way to pass authorization information to query in a custom change?
Is this the right way to pass authorization information: ```elixir defmodule MyApp.Changes.RemoveOldRecords do...
scope option, and pass the callback's context as the scopeNeed to ensure that only 1 row for a query criteria has a specific column value
UPDATE crew_members SET is_leader = true WHERE campaign_id = $1, and then update the specific Crew Member. I haven't really seen the ideomatic way of doing this in Ash.pass attribute to expression in calculation
starts_at. But how to make this expression generic that any attribute can be used.
```elixir
use Ash.Resource.Calculation
...Ash Update Many with Different Values
Ash Typescript with React Native
How to extract first element from `many_to_many`
many_to_many relationship and i want to get the first element from it. I have also a has_many relationship and can get the first element using has_one with from_many? but this is only the "merging" Resource. Is there something similar for many_to_many ?
I can't use calculations or aggregations, because they can't return a resource so has_one seems to be the only one left....