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.
JoinIs it possible to disable pagination entirely for a read action?
limit and offset params in queries/relationship loads, since the bespoke logic of the action kind of already accomplishes what pagination is doing, so it's confusing for the front end devs that consume my API to see those pagination params that are functionally redundant.
I found paginate_with and paginate_relationship_with, which seem to imply that I might be able to pass nil to disable pagination, but afaict that doesn't seem to do it. Is this something that's supported?...:none atomIs it possible to "pluck" a sibling using an expr?
type `vector` can not be handled by the types module Postgrex.DefaultTypes
lib/postgrex_types.ex
```elixir
Postgrex.Types.define(...Can I pass an argument to a custom policy check
publisher, book, chapter, user, permissions.
My relationships look like the following:
Users are given permissions to a publisher. These permissions are an array of arbitrary strings.
...AshOban and Policies
bypass AshObanInteraction do
authorize_if always()
end
bypass AshObanInteraction do
authorize_if always()
end
Short-lived Tokens in Ets-backed Resource
How can I return vector_cosine_distance from search results?
vector_cosine_distance(full_text_vector, ^search_vector) for debugging purposes. I tried to use a calculation, but I won't have access to search_vector. In Ecto I'd use a virtual field and use select_merge. What is the correct approach in Ash here?
```elixir
read :search do
argument :query, :string, allow_nil?: false...How to annotate generic action returning records
__MODULE__ is not recognized so for now I'm using :struct but I don't think that's completely right.Issue when attempting to encrypt union fields with AshCloak
Multiple checkbox form
How to list calculation without raw queries
:full_url. The calculation basically just concats the two with "://" in between. If I want to get a list of full urls for all my resources, I learned I can do this MyResource |> Ash.Query.load(:full_url) |> Ash.list!(:full_url). But I can't figure out how to do this as an aggregate or an action. Is it possible? Is this the right way to do it? I think aggregates always require a relationship.Relying on metadata on "public" API an anti-pattern?
MyApp.Accounts.Session resource that puts a token in the metadata during the create action since the token is hashed before inserting into the DB. The public API on the domain exposes it through an Accounts.create_session action. Do we really want callers to be doing Resource.get_metadata on the result in that public context to get the token or is that an anti-pattern? Is there a better way to be surfacing that information? For example:
```elixir
def my_caller_func do
# ... other code...How to use field policies to show/hide fields in a UI?
%ForbiddenField{}, Phoenix HTML doesn't know how to deal with it.
What's the best practice for doing this in the UI? The only thing I can think of is to use is_struct(resource.field, Ash.ForbiddenField everywhere....How to load a nested relationship with a tenant?
ash read_one bug?
Ash.read_one(Submission, id: submission_id) does not work
```...Single attribute join via belongs_to
Confirmation
AshAuthentication trusted audiences
trusted_audiences to ensure that a user signs in from one of the tenants, but reject all others.
I have set it up as described in the docs, but when I test it locally by only allowing a "fake" audience in the list of trusted audiences, I'm still authorized to login. Do I have to do anything else to make this work, or have I misunderstood something?
```elixir...trusted_audiences but struggles with using the /common/.well-known/openid-configuration endpoint because it contains a placeholder {tenantid} in its issuer which is not supported natively by assent. This cause the issuer validation to fail, because the issuer in my token contains my real tenant-id.
Could work, but requires a custom strategy?
2. Continue with using OAuth2 strategy. Works out of the box with multi-tenant applications, but needs to implement a custom trusted_audience handler either as a change function or in auth controller success callback (and then deny access unless audience matches allow-list)....where's the best place to run possibly long running queries on the DB after an insert / bulk insert?