superchris
As part of my experiments in learning Ash, I decided to extract a sortable, paginated table component we use on one of our projects and rework it to use Ash. It turned out to be not too terrible, so I thought I’d [share it with the world. It’s very early, and has almost no styling. But it works, has tests, and if nothing else might serve as a useful example for folks to build on.
As with all my work, feedback and contributions are welcomed ![]()
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Introductory paragraph
I’ll be looking for a keen junior or someone that has a couple of years experience in the real world (so you’ve be...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
Awesome
zachdaniel
Some small notes:
Additional action opts
You’ll likely want to accept additional options to the action for things like authorization, multitenancy, etc. A name used for this in some places is
action_optsorread_opts.Multiple pagination strategies
There is keyset and offset pagination available in core, for keyset pagination, you’d replace
offsetwith anafterorbeforekey. With that in mind, you might want to acceptpage_opts(or perhaps use theaction_optsvsread_optssuggestion above to encompass the concept)mxgrn
Recently did some related work, more in the ‘batteries-included’ fashion. Here’s a live demo of a PoC that I prepared for a former client of mine:
https://ash-table-poc.mxgrn.com
It’s note a library (although I did put effort into making the table a reusable component), but maybe some ideas could be an inspiration. E.g. the table auto-configures itself from the Ash resource. Columns can be dragged around and resized, inline editing is supported, etc.
superchris
That’s a really nice example. There’s definitely some bits I’d like to borrow and incorporate. I love how it generates the columns for you and does the whole CRUD lifecycle. Nice work, thanks for sharing that!
superchris
Thanks Zach, having a
read_optionsas assign you can pass definitely makes sense. Supporting multiple pagination strategies also would be great, just got give it a little more thought in terms of how to support it.superchris
Following @zachdaniel 's suggestion, released 0.2.0 which allows
read_optionsto be passed to specifytenant,actor, etczachdaniel
Noice!
Something you might also consider is allowing a list as the
sort_key, and constructing thesort_exprautomatically if they don’t provide anapply_sort. Would look something like this:superchris
Hmm.. that’s really interesting. I wonder if it might be even nicer to lightly parse the sort_key (not married to this name) and if there is a
.in it turn it into a path.zachdaniel
that is clever, I’m into it
zachdaniel
now that you point it out though, that is just what ash core should do also perhaps. People are typically pretty annoyed to break out
expr_sortjust for a to_one related field.its on the roadmap now: Support related sorts via dot separated identifiers in sort · Issue #1272 · ash-project/ash · GitHub