Code of Conduct
AI Policy
Is your feature request related to a problem? Please describe.
Hi! It's really easy to specifiy custom indexes (and statements) using AshPostgres, thanks! However, I'd also like to specify the sorting direction. I'm building an AuditLog resource, and in case a of compliance query, I'd like the logs to be already sorted by date, for example.
Describe the solution you'd like
We could specify the sorting direction like this:
custom_indexes do
index desc: :occurred_at
index [:action, [desc: :occurred_at]]
end
And it would generate the following Ecto migration:
create index(:events, [desc: :occured_at])
create index(:events, [:action, desc: :occured_at])
I guess we'd need to modify the index DSL and the type of fields would become something like atom | String.t | keyword | list(atom | String.t | keyword).
I've never hacked Ash before, but I might try to open a PR for this, if you want.
Describe alternatives you've considered
No response
Additional context
No response
Code of Conduct
AI Policy
Is your feature request related to a problem? Please describe.
Hi! It's really easy to specifiy custom indexes (and statements) using AshPostgres, thanks! However, I'd also like to specify the sorting direction. I'm building an AuditLog resource, and in case a of compliance query, I'd like the logs to be already sorted by date, for example.
Describe the solution you'd like
We could specify the sorting direction like this:
And it would generate the following Ecto migration:
I guess we'd need to modify the
indexDSL and the type offieldswould become something likeatom | String.t | keyword | list(atom | String.t | keyword).I've never hacked Ash before, but I might try to open a PR for this, if you want.
Describe alternatives you've considered
No response
Additional context
No response