josevalim

josevalim

Creator of Elixir

Hello everyone,

This past weekend we have released Ecto v2.1.0-rc.5, hopefully the last release candidate for Ecto v2.1: ecto/CHANGELOG.md at master · elixir-ecto/ecto · GitHub

If you were using “or_where/or_having” from previous RCs, note “or_where: ^keywords” changed behaviour in this last RC.

We have also released Postgrex 0.13-rc which includes a new API for extensions that is about 40% faster when running Postgrex queries.

Showing Posts 1 to 7

lucidstack

lucidstack

Thank you very much for this, @josevalim!

I’ve noticed that you haven’t got a git tag for this version, which breaks the links from hexdocs. Just a heads-up!

josevalim

josevalim OP

Creator of Elixir

Done, thank you.

thousandsofthem

thousandsofthem

Question regarding dynamic expressions, don’t get how they work nor why do we need them. from changelog:

dynamic = false

dynamic =
  if params["is_public"] do
    dynamic([p], p.is_public or ^dynamic)
  else
    dynamic
  end

isn’t it means false([p], p.is_public or ^false). o_O

Regular non-dynamic code looks like

q = Post
q = 
  if params["is_public"] do
    q |>  where([p], p.is_public)
  else
    q
  end
josevalim

josevalim OP

Creator of Elixir

@thousandsofthem imagine you need to go through a bunch of parameters in no particular order. For such, you ned to start with an initial value (in this case, false) and compose them arbitrarily until it is interpolated. The Ecto book also contains examples of where to use dynamic.

thousandsofthem

thousandsofthem

Thanks.
Still, false(..) looks counterintuitive, it feels wrong that i can apply () to boolean value
(i.e. dynamic = false; dynamic = dynamic(...))

bobbypriambodo

bobbypriambodo

Echoing @thousandsofthem, I’m inclined to think that there are two different semantics of dynamic in that snippet: one is a value (initialized as false and gets updated with the ifs) and another is a function/macro. Is that right?

josevalim

josevalim OP

Creator of Elixir

Hrm, not quite. I will work on better examples.

— All posts loaded —

Where Next? Top

Trending in News Top

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
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
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 & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews