Localize SQL version 1.0.0
[1.0.0] - 2026-07-31
Renamed from localize_ecto to localize_sql — the package is about SQL databases (collations, serialization, migrations), not Ecto in general, which can be used without a database. The Localize.Ecto.* module namespace and the mix localize.ecto.audit task are unchanged; the app, config key (:localize_sql), env var (LOCALIZE_SQL_SQLITE_ICU) and priv/localize_sql/ path are renamed.
localize_sql grows from locale-aware collation into the SQL home for every Localize type — serializing the full set of Localize and Elixir data types and generating the tagged-decimal aggregate machinery ex_money_sql builds on.
Added
-
Localize.Ecto.TaggedDecimaland itsDDLgenerate a PostgreSQL composite type with tag-guardedsum/avg/min/maxaggregates and+/-operators for any tag-plus-decimal value; a mismatched tag (euros plus yen) raises in the database.ex_money_sqlnow buildsmoney_with_currencyon this rather than its own SQL. -
Unit serialization, folded in from
localize_units_sql:Localize.Unit.Ecto.{Composite,Map}.Typeand theLocalize.UnitWithUsagevariants,Localize.Unit.DDL(nowsum/min/max/avgforcldr_unitandcldr_unit_with_usage), andmix localize.unit.gen.migration. -
Ecto types for the remaining data types:
Localize.Currency.Ecto.Type,Localize.LanguageTag.Ecto.Type,Localize.Territory.Ecto.TypeandLocalize.Script.Ecto.Type(text);Localize.Ecto.Type.IntegerRangeand.DateRange(int8range/daterange);Localize.Duration.Ecto.TypeandLocalize.Ecto.Type.Duration(interval). -
Localize.Ecto.Rangeprovides query macros for PostgreSQL range columns — containment, overlap, adjacency, the bound accessors and the range aggregates — andLocalize.Ecto.Range.Migrationcreates a time range type, thebtree_gistextension and theno_overlap/3exclusion constraint that forbids overlapping bookings. -
Localize.Ecto.Migration.Generatorrenders and writes migrations for the SQL-generating mix tasks.
Fixed
Localize.UnitWithUsage.Ecto.Composite.Type.cast/1now accepts a string-keyed map with no"usage"key, casting it as a unit without a usage. Only the atom-keyed form tolerated the key's absence, so an HTML form — which submits string keys — could not cast a unit unless it also submitted a usage.
Changed
-
Requires
localize ~> 1.0.postgrexis an optional dependency; the range, duration and tagged-decimal composite types compile only when it is present, so a SQLite-only or collation-only consumer carries nothing extra. -
The
localize_units_sqlpackage is superseded — its unit serialization is folded in here, and itssum-only aggregates are replaced bysum,min,maxandavgfor bothcldr_unitandcldr_unit_with_usage.