MikaAK
EctoShorts - A library to help compose and create ecto queries with ease
Hello everyone!
I wanted to introduce EctoShorts to everyone here at the forum.
This was one of the first libraries I created and have been using in production apps for over 5 years. I decided to open source it a few years ago and have been using it across multiple companies, including the most recent company I’m at https://blitz.gg, where it’s used for almost all our ecto code. We use this to ingest and manage hundreds of billions of rows within Postgres, with millions of new rows being created daily (tl;dr it works at scale). It’s so useful, I even teach how to use it as a part of my course, so that developers can move quickly and focus on what matters!
I’m posting this now because I created this blog post to go alongside it, explaining a bit of the rationale and reasoning for creating this library, as well as some tips on how to work with it best! Not only that but I recently released 1.1.0 which includes the ability to query on relations as well now!
Most Liked
MikaAK
Dates do work since they’re simple > or < operations in ecto!
MikaAK
I realize I forgot to comment on HOW to do > and < filters. For this we have %{field: %{gt: value}} or %{field: %{lte: value}}
Hope this helps! There’s some cool filters on the todo list, like or queries and preloads and that would cover almost 90% of my querying use case, if there’s any others that you feel are missing let me know
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









