All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Types of changes
Added
for new features.Changed
for changes in existing functionality.Deprecated
for soon-to-be removed features.Removed
for now removed features.Fixed
for any bug fixes.Security
in case of vulnerabilities.
put your changes here
-
renamed library from
ecto_named_fragment
toecto_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
andfrag/2
as a shorthand for inline and named fragments depending on the arity it is called with.
- the
EctoNamedFragment
module needs to be imported now (no moreuse
) - changed interpolation syntax to use string interpolation (#{}). Please change your query strings from
named_fragment("foo(:a, :b)", a:1, b:2)
tonamed_fragment("foo(#{:a}, #{:b})", a:1, b:2)
- this allows better syntax highlighting of param names within the query
- it also drastically simplifies implementation of this library and improves compile times of this library as well as of the named_fragment macro
- initial release