MikaAK

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!

First 4 of 4 Posts! Switch mode

KristerV

KristerV

very cool! i found myself remplementing a certain pattern over and over again and i think the result is pretty much what you’re doing here.

just to check (and let you know of interest) does this support comparison of dates?

MikaAK

MikaAK

Dates do work since they’re simple > or < operations in ecto!

TwistingTwists

TwistingTwists

It was unbelievable for me at first! Such a cool feature!

MikaAK

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

Where Next?

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
385 14863 120
New
JesseHerrick
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
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
zachdaniel
Introducing AshStorage! Attachment and file management that slots directly into your resources :smiling_face_with_sunglasses: I had hope...
New

Other Trending Topics Top

JesseHerrick
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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement