AF
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.
JoinAF
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.
JoinAshEvents: AshPostgres.DataLayer.Info.repo/1 is undefined
After installing ash_events on a working Ash+Postgres app (by adding {:ash_events, "~> 0.2.0"}), I get this warning when I start it. Application works otherwise but I don't have ash events wired to any resources yet.
warning: AshPostgres.DataLayer.Info.repo/1 is undefined (module AshPostgres.DataLayer.Info is not available or is yet to be defined)
│
25 │ pg_repo = AshPostgres.DataLayer.Info.repo(changeset.resource)...
Solution:
I do have
ash_postrgres . Closing this until it's a problem. For now it's just a warning.How can change dir in Igniter.add_task cross platform? (suggestion)
i have no windows to test it, just get the response from
claude that can be wrong
it says it is not cross platform code for example in windows has problem
```elixir
def run_install(igniter) do...Solution:
So you need to write a mix task that does what you want
Ash-AI MCP and Cursor
My MCP config in Cursor:
```
{
"mcpServers": {
"tidewave": {...
Solution:
```
"ash_dev": {
"command": "npx",
"args": ["mcp-remote@0.1.5", "http://localhost:4000/mcp/ash"]
}...
ash_double_entry and updating transfers
I see a unit test that is capable of updating a transfer.
However I cannot get it to work and see this error.
```elixir...
Solution:...
update :update_balance do
change get_and_lock_for_update()
end
update :update_balance do
change get_and_lock_for_update()
end
Reusable Ash Resources
I've got a commonly-used Ash resource that I'd like to put in an Elixir package for reuse across Phoenix apps. Is anyone doing this? Can anyone point me towards examples or best practice?
This works, but the
otp_app is hardcoded:
```
defmodule Packaged.Resource do...Solution:
that solved it for me. thanks again for the tips.
AshArchival
Dear team,
I am currently trying to implement AshArchival.
In order to be able to read the archived and none archived value. the documentation says I need to create a separate resource....
Igniter `Proceed with changes` message when there is no changes
Hi, as you see this is my simple code for igniter, i am using
update_file function, because before it i have a function that ensure_package_json_exists.
I do not know why it shows me even there is not changes Proceed with changes?
It is is my bug?
I tried to use create_or_update_file function, but if file exist and there is not anything to change, it still shows Proceed with changes?
...Solution:
I think the latest version of igniter may have a fix for this?

livebook
Has anyone ever created some Ash resources and tried to use (ie create and interact with) them in a LiveBook without publishing code to Hex or a private repository? I'm in the middle of trying. The concept: use Livebook instead of iex. I know, crazy.
Solution:
The problem with the excellent educational livebook for my case is that I'm not learning Ash -- I want something better than IEx to interact with my code (which depends on Ash and a ton of other functionality), like a library. I am not just asking the universe for a solution. I have a solution for my app, and it's pretty bad. I will document this and I'm closing this issue. Anyone who stumbles on this post should be aware that they should not attempt.
createdby / updatedby
When ash_authentication is in use, do you recommend adding created_by and updated_by references for other resources to the user resource.. or is this a dumb thing to do?
Solution:
It depends entirely on the situation 🤷♂️
How to create a negative test for a verifier
Hi, I'm working on adding some verifiers to the transformer for the Ash Neo4j DataLayer, and I've got a simple Verifier that checks neo4j convention on the resource label
Here is the verifier:
```elixir...
Solution:
Define the module inside the test block
Add custom key in a action or other macro without changing the core of Ash
Hi, i am creating a dashboard lib, that support multi ACL, so i want to ask i can add a custom key inside
action without changing Ash core? and access it for my dashboard? it is not just user role access for example another options like where this action should be shown or the icon of it and etc
Or i am forced to create my own macro?! out of action or etc! (this is very dirty way)
Thank you...Using Ash.Query in Ash.Query.load
After updating ash from 3.4.62 to 3.5.12 the following code causes an error. How do I fix this?
Error.Unknown.UnknownError{
error: "** (BadMapError) expected a map, got: nil",
field: nil,
value: nil,...
Pubsub isolation in tests
I have a Phoenix application which has LiveView tests.
When i run the tests in async mode the broadcasts from one test can interfere with other tests. What is the best way to handle this?
Scenario:
* Test 1 opens a live connection to a live_view which listens to broadcasts on a Ash resource...
Policies: authorize if user is an admin of the requested resource's organization
I have a group resource with these relationships:
```
belongs_to :educator, User do
source_attribute :educator_id
destination_attribute :id...
Read actions
I have this read action:
```
read :groups_by_organization_id do
argument :organization_id, :uuid, allow_nil?: false
...
enabling multi tenant for graphql
turning on graphql for first time in my app (multi tenant)
```elixir
router.ex
import AshAuthentication.Plug.Helpers...
AshOban job failures
I have a job that runs using AshOban, which I find a very nice way of doing things tbh, as most things you've done so far!
However it seems to me that the only way to handle failures is to give it an action to run. For example setting the state to failed, however I'd like to be able to see the failure in Oban apart from setting the Resource as failed. I have scoured the documentation but I don't see a way of having the Oban job fail on failure. Am I missing something? Was there a specific reason this is like this?...
How to use datetime_add in set_attribute?
Hi guys, a quick question, maybe I'm doing something stupid...
I want to increase
trial_ends_at by 7 days in an action. I thought
```...Writing a Change with DB lock
I have a
change that do some db queries in order to verify that the value being inserted in a foreign key is valid. Since I'm being based on other records to validate this field I need to lock those to prevent them to be modified in the middle of the change.
Before adding any locking to my change I decided to test this concurrent scenario so first I make it fail so then I could be certain the problem is solved once I lock the records.
My current issue is that the tests mean to run concurrently are not failing. No mater how many times I run the tests, the records are being updated in order as if a locking mechanism were in place...Slow pages ... due to too many load of data...
Hi Community, In a platform I am currently developing, some pages are slow. Too many load of data...
I am wondering if there is a config option that permit to have in the log the files/component/lines that call the ash.load or Ash.get... which do the SQL access to the DB ? In order to analyze the issue quicker ?...