josevalim

josevalim

Creator of Elixir

See the release notes: https://github.com/elixir-ecto/ecto/releases/tag/2.2.0-rc.0

To try it in your projects: {:ecto, "~> 2.2.0-rc", override: true}.

Showing Posts 1 to 10

OvermindDL1

OvermindDL1

Hah, I was just typing up a post!

My post was:

Just wanted to note that an awesome feature has been added to Ecto 2.2.0-rc.0 that was just released. select_merge (and select(blah, merge(bloop)).

This is a feature that has been wanted a few times here and so just want to point it out (I’ll be rewriting and simplifying a lot of my complex queries soon!). :slight_smile:

See the docs for it at: Ecto.Query – Ecto v2.2.0-rc.0

OvermindDL1

OvermindDL1

Also, is it just me or are the docs showing “Toggle Sidebar” floating on the top sidebar button? It looks like the sr-only css is missing…

josevalim

josevalim OP

Creator of Elixir

Do a hard refresh on the docs page. :slight_smile: And I would love some feedback on the select_merge feature.

OvermindDL1

OvermindDL1

Hmm, just did. Also told chrome to ignore the cache and fetch on every request and it still is not getting a css where .sr-only exists. it is currently requesting https://hexdocs.pm/ecto/2.2.0-rc.0/dist/app-091c05798a.css if that helps.

Initially it looks awesome! It will so very much simplify a lot of my complex monstrous builders to this old Oracle horror, plus I can return less data in many areas now too instead of dummy data! :slight_smile:

OvermindDL1

OvermindDL1

Also, have you thought about supporting this syntax for merging selects? It seems much more readable to me (select_merge can get lost in the keyword lists in my eyes now that I’m using it and merge seems foreign):

query = from p in Post, select: %{}

query =
  if include_title? do
    from p in query, select: %{p | title: p.title}
  else
    query
  end

query =
  if include_visits? do
    from p in query, select: %{p | visits: p.visits}
  else
    query
  end
law

law

Yayyyy - Having on_conflict support a constraint name is going to replace a bunch of manual upserting in my codebase, and being about to use associations with put_change is also excellent.

Thank you :tada:

sergio

sergio

I love this change the most:

Ecto now will also warn at compile time of invalid relationships, such as a belongs_to that points to a schema that does not exist.

Thanks for the hard work!

OvermindDL1

OvermindDL1

It’s fixed now, probably just had to propagate through the cloudflare CDN or so. ^.^

axelson

axelson

Scenic Core Team

[Ecto.Migration] Add reversible execute/2 to migrations

Blew my mind. Is Ecto able to automatically determine if the arbitrary SQL is reversible? Or does it just skip that execution on rollback?

Edit: nevermind. I see that it is execute/2, the second argument is what you execute on rollback. Makes sense.

ijunaidfarooq

ijunaidfarooq

while you are rewriting already will you please mention here? one of use case as well? that how and where it helped you?

Where Next? Top

Trending in News Top

ericmj
Release: Release v2.6.0 · hexpm/hex · GitHub Announcement: Hex v2.6 released | Hex Backwards incompatible changes Require --key in mix...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews