austinthecoder
I created a project named Qry that allows you to query your domain with a nice syntax, returning results as nested maps – a concept similar to GraphQL or Ecto’s preload.
This is a personal need, but wanted to share it in case others find it useful. It’s in a working alpha state, but lots of ideas to come like improved error handling and async data loading (like dataloader).
There’s an example at the top of the docs: qry v0.4.1 — Documentation
Would love feedback.
Trending in Announcing
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
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
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
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
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
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
:microphone: ElixirConf 2026 - Call for Talks is open!
We’re heading to Chicago :united_states:
:round_pushpin: In person + virtual
:d...
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
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mwhitworth
As feedback - a few more introductory paragraphs about:
would be very helpful. I think it certainly covers a gap in most libraries, especially in backends with complicated ephemeral and internal state (a lot of ORM systems assume a backing database), but a couple of paragraphs would market that a lot better.
austinthecoder
The main benefits of this library are the same benefits of GraphQL – declaratively fetching data, frees you from thinking about the implementation details of how that data is cobbled together. The exact shape of our database almost never matches what the end user sees. As you said, sometimes data is ephemeral, derived, excluded, pulled from other sources/APIs, etc.
I don’t know of any other solutions for this. Ecto has
preloadfor the database layer, but it doesn’t solve the problem described above. And of course there’s the absinthe library, but that’s if you’re using GraphQL.A lot of what I see goes like this: A requirement comes along to ensure deleted users aren’t removed from the database. So instead of using Ecto directly, a function is created:
Devs can use this function and not have to worry about how a user is fetched. There are a lot of growing pains with this style. For example, consider another function that gets added:
Uh oh, we forgot to exclude deleted users. Also, the caller of
fetch_org/1might not need the org’s users.With Qry, you’ll write the implementation functions for how data is loaded, then you’ll just use the main query interface everywhere:
In the
Domain.fetchfunctions for fetching users, you’ll exclude deleted users, and know that everywhereDomain.queryis called, and no matter what part of the graph users are attached, it’ll exclude the deleted ones.That’s just one example, but in general bigger/older apps tend to struggle with data loading growing pains.
LostKobrakai
I really like the idea of dataloader for internal use within a project. I’m wondering if this library does anything in regards to preventing n+1 queries, say you’re indeed loading thing from the db eventually. The docs doesn’t really show how this would eventually interact with a database.
austinthecoder
Glad you like the idea!
I would say preventing N+1s isn’t the job of Qry, but they’ll likely be avoided as a side-effect.
I’ve been on the fence of a design decision that is related to N+1s: whether to make the fetch functions alway fetch in batch. There are pros/cons here which I should enumerate. One of which (I think) would require you to create a schema-like file. Right now, Qry is a very light-weight wrapper.
You’re right that I should show a good example of how you might use this with Ecto. I was trying to do the simplest thing (hard-coded data) to emphasize that Qry is unconcerned with how your data is loaded.
Thanks for the feedback. I’ll put an example together.
LostKobrakai
Yeah, I totally get the idea that it should be agnostic to the actual data store. But on the other hand querying a database is the common case and that needs to be doable reasonably efficient. In the end it’s also not just a problem with databases, but anything where fetching items in certain batches is benefitial.
austinthecoder
For the org/user queries above, the fetch implementations for Ecto could look something like this:
Fetching users as a subfield of org ultimately runs the same
fetch(:users, args, context)function, but with anorg_idarg. That function can now be the source-of-truth for fetching users, regardless of where users are in the graph.