Skip to content

Releases: tessi/ecto_fragment_extras

v0.3.0 - A rename and support for inline fragments

05 Aug 19:52
Compare
Choose a tag to compare

With this release we add support for inline fragments in addition to named fragments. Since we have more than one fragment type, a rename of the package was due.

  • renamed library from ecto_named_fragment to ecto_fragment_extras because it contains a little more than just the named_fragment() macro now 👇

  • added inline fragments which allow inlining fragment params into the query string:

    inline_fragment("coalesce(#{users.name}, #{^default_name})")
  • added frag/1 and frag/2 as a shorthand for inline and named fragments depending on the arity it is called with.

v0.2.0 - Query Interpolation as if it is a string

23 Jul 22:38
Compare
Choose a tag to compare

Change interpolation syntax to be similar to string interpolation

After a discussion with Ecto maintainers

it seems like this feature will not be part of Ecto proper. However, the discussion revealed
a better implementation of this library (thanks @bamorim !) by using string interpolation instead of atom-like names.

This gives:

  • better syntax highlighting for param names within fragment query strings
  • better compilation time (for usage of the macro as well as for this lib)
  • less dependencies for this library