Skip to content

outstanding issues with dynamic refactor #81

Closed
@kernel-io

Description

@kernel-io

As discussed on Discord here are the outstanding issues I am encountering in my application while using the dynamic refactor of ash postgres.

  1. Inability to use DB enums as Ash explicitly casts the bindings to a varchar instead of just leaving it uncast - i.e: SELECT * FROM burgers WHERE status = $1::varchar (instead of just = $1) - also the storage_type override on Ash.Type has no effect on this.

  2. Ash gets confused while trying to load an aggregate that has a filter on it
    count :total_leased_count, :assets, filter: expr(is_nil(active_order_service.id) == false)

In my case I have AssetType which has many Assets, which in turn has one active OrderService (has_one :active_order_service, OrderService, filter: expr(fragment("? @> now()", period))), I have a count aggregate defined on AssetType which counts the number of Assets with an active OrderService, OrderService has a range type column called period.

error is unknown error: {%Ecto.SubQueryError{exception: %Ecto.QueryError{message: \"could not find named binding 'as(nil)') while trying to load the AssetType with the count

  1. I have previously needed to define the filter on the aggregate and relationship for it to work correctly, I can't tell if this has been fixed as point 2 is blowing up first.

  2. There was an issue with GROUP BY on aggregates, which I think has been resolved, but I can't fully test because of 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions