Ash Framework

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.

Join

support

showcase

today-i-learned

aggregates of list with various filters

I know there are aggregates and have worked with them already. But so far, aggregates work somewhat only on a "row"-level of a resource (hope I got that correct) Is there an easy way to support on "resource"-level?...

ash_authentication update totally breaks a signed in user

If i was already logged in, i get redirected to the login page, but it's perptually redirecting me with the attached log

AshAuthentication confirmation page not using correct layout

The page served for /auth/user/confirm_new_user?confirm=longtokenhere does not appear to be using my application's layout template, because it does not have any of the elements in <head> that the rest of my app has. My router looks like this: ```elixir defmodule MyAppWeb.Router do use MyAppWeb, :router...
Solution:
If I explicitly pass path: "/auth/user/", then the root layout is used. I'm now thinking the URL I send in the email is incorrect.

sign-in tokens or not

Spun out from https://discord.com/channels/711271361523351632/1385038293284159588 When would you want to disable sign-in tokens?...
Solution:
if you had a massively high traffic system, or a custom authentication setup, you might not need them

Generating liveview - no users shown

After using ash-hq installer I continued with:
mix ash_phoenix.gen.live --domain MyApp.Accounts --resource MyApp.Accounts.User --resource-plural users
mix ash_phoenix.gen.live --domain MyApp.Accounts --resource MyApp.Accounts.User --resource-plural users
But /users doesn't list the users (there is one - my own). Console says
[debug] MyApp.Accounts.User.read: skipped query run due to filter being false"
[debug] MyApp.Accounts.User.read: skipped query run due to filter being false"
...

Installer fails because of postgres password

When using the installer from ash-hq: ``` mix archive.install hex igniter_new --force mix archive.install hex phx_new 1.8.0-rc.3 --force ...

Can't publish the same action twice

Hello, I have a challenge with notifications that I don't know how to solve. Would appreciate any advice! When an interaction that is part of the session is updated, I want to sent notification to both the interaction and the session. The below doesn't work: ```elixir pub_sub do...

What's the best way to sort records returned from `:create` action?

I want the records returned from a create action to be sorted by some related record fields. I'm loading the relationship in the create call, but not sure how to do the sort.
Solution:
Yeah, at the moment I don't think there is a way to sort them by some custom criteria

Foreign key reference naming and Ash.Generator

On my resource I have: ``` references do reference :region, name: "FK_dfwoyi1w884tqx68rctmbut4u"...
Solution:
regression perhaps? want a failing pr submitted to ash_postgres?

Ash.Vector clashing with Pgvector

Hey, I need help with the following error. Is there a setup step that I'm missing with Ash.Vector? ``` Unknown Error * ** (FunctionClauseError) no function clause matching in Pgvector.new/1...
Solution:
Ah, I think I found it. Maybe there should be a link to the setup instructions in AshPostgres.Extensions.Vector documentation from the Ash.Vector docs. Ash Vector: https://hexdocs.pm/ash/Ash.Vector.html AshPostgres.Extensions.Vector: https://hexdocs.pm/ash_postgres/AshPostgres.Extensions.Vector.html...

Postgresql error after migrating to ash_archival

I get this error: * ** (Postgrex.Error) ERROR 42703 (undefined_column) column "archived_at" does not exist After running the migration of AshArchival on my User resource It didn't create the archived_at column for some reason...
Solution:
Did you run mix ash.codegen to generate migrations?

AshAI tool calling: framework does not automatically run the tool?

I'm working through my first tool calling experience in a LiveBook as a learning exercise. AshAI is adding a %LangChain.Function{} to the chain's tools list, and the LLM responds with :assistant role Message containing the %LangChain.Message.ToolCall{} 🎉 I suppose I expected the magic to continue, that the framework would intercept that ToolCall, automatically run the tool, and then respond with a :tool result message to continue the chain. ...
Solution:
Yeah, LLMChain.run takes a mode option

AshAuthentication require confirmation not working

I am going through the Confirmation Tutorial, and even though I have added require_confirmed_with to the password strategy block, I can still log in before visiting the confirmation URL in the email. Worth noting that I started adding AshAuthentication to my application before the Igniter installers were added, so my resources may be missing some optional-but-recommended blocks that the installers add.
Solution:
Okay, fix released, docs updated

AshPhoenix.Form.submit is triggering change function to run twice

Say I have a custom change module, like so: ```elixir defmodule MyApp.Accounts.Changes.MyCoolChange do use Ash.Resource.Change...

Accessing relationship fields inside Ash.query.filter

I have this: ``` defp user_query(context) do User |> Ash.Query.select([:first_name, :last_name])...

Define Ash Type for Ash Resource with Data Layer?

Embedded Ash resources are automatically Ash Types. Can Ash resources with data layers automatically define a type, as well?

Filtering inside a load

Hopefully an easy one. I have a code interface that I'm calling inside a calculation module like this: ``` defp calculate_least_engaged(organization, after_datetime, before_datetime) do descendant_orgs = Organization.get_descendant_organizations!([organization.id], load: [users: [:first_name, :last_name]]) ......

AshGraphQL or query does not parse to correct sql

query: SELECT d0."id", d0."user_id" FROM "doctors" AS d0 LEFT OUTER JOIN "public"."users" AS u1 ON d0."user_id" = u1."id" WHERE (ash_elixir_or(u1."id"::uuid, ARRAY[$1,$2]::uuid)) AND (d0."entity_id"::uuid = $3::uuid::uuid) ORDER BY d0."id" LIMIT $4
query: SELECT d0."id", d0."user_id" FROM "doctors" AS d0 LEFT OUTER JOIN "public"."users" AS u1 ON d0."user_id" = u1."id" WHERE (ash_elixir_or(u1."id"::uuid, ARRAY[$1,$2]::uuid)) AND (d0."entity_id"::uuid = $3::uuid::uuid) ORDER BY d0."id" LIMIT $4
this log is from a query ```gql...

Logging in via the API

Working through authorizing api access for authentication and cant seem to login via the api, however I am able to create an account via the api
No description

How to use date_range filter in Cinder.Table

Hey @Rebecca Le first of all, great work with this project. Our custom hacky data table with pagination broke with some deps.update and i added this so quickly without any effort 🙌 Now i am trying to use the date time range filter but when picking any date it raises ```elixir ** (Protocol.UndefinedError) protocol String.Chars not implemented for type Ash.Query (a struct)...
Solution:
can you try main again? have just pushed another fix (and include_time should work properly now as well)