# ecto_sparkles v0.4.0 - Table of Contents

> Helper library to better join + preload Ecto associations, and other goodies

## Pages

- [EctoSparkles](readme.md)

## Modules

- [EctoSparkles](EctoSparkles.md): 
Some helpers to sparkle on top of [Ecto](https://hexdocs.pm/ecto/Ecto.html) 
- [EctoSparkles.AutoMigrator](EctoSparkles.AutoMigrator.md): Runs ecto migrations automatically on startup (add this to your app's supervision tree)

- [EctoSparkles.Changesets.Errors](EctoSparkles.Changesets.Errors.md)
- [EctoSparkles.DataMigration](EctoSparkles.DataMigration.md): A behaviour implemented by our data migrations (generally backfills).
- [EctoSparkles.DataMigration.Config](EctoSparkles.DataMigration.Config.md): Configuration for a `DataMigration` behaviour module, used by the `DataMigration.Runner`.
- [EctoSparkles.DataMigration.Runner](EctoSparkles.DataMigration.Runner.md): Runs a `DataMigration`

- [EctoSparkles.ErlangTermBinary](EctoSparkles.ErlangTermBinary.md): A custom Ecto type for handling the serialization of arbitrary
data types stored as binary data in the database. Requires the
underlying DB field to be a binary.

- [EctoSparkles.JSONSerdeData](EctoSparkles.JSONSerdeData.md): A custom Ecto type for handling the serialization of arbitrary data types stored as JSON data in the database. Requires the underlying DB field to be a map / JSONB field.

- [EctoSparkles.Log](EctoSparkles.Log.md): Log Ecto queries, and output warnings for slow or possible n+1 queries
- [EctoSparkles.Migrator](EctoSparkles.Migrator.md)
- [EctoSparkles.NPlus1Detector](EctoSparkles.NPlus1Detector.md): Accumulates repeated SELECT shapes per Proces or unit of work (LiveView mount/params/event, HTTP request, Oban job) for N+1 detection.
- [EctoSparkles.NPlus1Reporter](EctoSparkles.NPlus1Reporter.md): Span-end reporting for `EctoSparkles.NPlus1Detector`: attaches telemetry handlers on Phoenix LiveView/router and Oban span endings that flush the per-process query counts at the end of each unit of work and log ONE consolidated warning per span for shapes repeated ≥ the threshold (`config :ecto_sparkles, :n_plus_1_threshold`, default 3).
- [EctoSparkles.SanitiseStrings](EctoSparkles.SanitiseStrings.md): Provides functions for sanitising input on `Ecto.Changeset` string fields.

