Note that localize_units_sql is supported on Elixir 1.17 and later only.
Localize Units SQL v2.1.0
This is the changelog for Localize Units SQL v2.1.0 released on October 25th, 2026.
Bug Fixes
Requires
localize ~> 1.4. Version 2.0.0 requiredlocalize ~> 0.22, which no Localize 1.x release satisfies, so it could not be installed alongside Localize 1.0 or later.cast/1of every type returns a cast error for a string value with trailing text, such as"12abc", where it raisedWithClauseError.Localize.Unit.DDL.drop_aggregate_functions/1dropsunit_with_usage_state_function, which it named wrongly and so left behind. A migration generated by 2.0.0 keeps the olddown, so rolling back the type migration fails: changeunit_state_function(agg_state cldr_unit_with_usage, ...)in thatdowntounit_with_usage_state_function(...).equal?/2of every type compares the unit name and the exact value, and the with-usage types also compare the usage, so Ecto now writes a change of unit or usage. It used to compare quantities across units as floats and ignore usage, so such a change was silently dropped.cast/1of every type casts a float value, where it raisedFunctionClauseError. The with-usage types cast a string-keyed map that has no"usage".load/1of every type returns:errorfor a value of the wrong shape, where it raised. The map types load a float value.
Localize Units SQL v2.0.0
This is the changelog for Localize Units SQL v2.0.0 released on April 24th, 2026.
Breaking changes
The package has been renamed from
ex_cldr_units_sqltolocalize_units_sql. TheCldr.Unit.*modules are nowLocalize.Unit.*(for exampleCldr.Unit.Ecto.Composite.TypebecomesLocalize.Unit.Ecto.Composite.Type). Existing schema and migration references must be updated.Supported on Elixir 1.17 or later only.
Requires the unified localize package in place of the
ex_cldrfamily of dependencies. The CLDR backend module (e.g.MyApp.Cldr) and its configuration are no longer used. Configure locales throughconfig :localizeinstead.Localize.Unituses string unit identifiers (for example"meter") and string usage values (for example"person"), rather than atoms. Code that previously passed:meterorusage: :personshould pass"meter"/usage: "person".Localize.Unit.new/2,3takes the value as the first argument and the unit identifier as the second. TheCldr.Unit.new(:meter, 100)form is no longer valid — useLocalize.Unit.new(100, "meter").The
:unitfield on the struct has been renamed to:name.jasonis no longer a declared dependency. Postgrex defaults toJasonforjson/jsonbcolumns; configureconfig :postgrex, :json_library, JSON(Elixir 1.18+) and runmix deps.compile postgrex --forceonce since Postgrex captures this setting at compile time.
Enhancements
- The Postgres composite type names (
cldr_unit,cldr_unit_with_usage) and aggregate function names are unchanged, so existing databases do not require a schema migration.