Phoenix LiveView for a Searchable, Paginated List Without a JavaScript SPA
Phoenix LiveView lets you build interactive search and pagination in Elixir without a JavaScript SPA. Learn the lifecycle, a worked example, and the memory trade-offs.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Phoenix LiveView lets you build interactive search and pagination in Elixir without a JavaScript SPA. Learn the lifecycle, a worked example, and the memory trade-offs.
Learn how to diagnose and fix common Ecto pagination issues caused by misuse of limit/offset, version differences, and changeset validation.
Use Ecto.Multi when one request must create or update several rows and fail as a single unit. It compiles named steps into one database transaction and returns the failed step name.
Ecto.Changeset.cast/3 whitelists permitted fields and coerces types, blocking mass-assignment attacks by construction — but it silently drops unknown keys and does no business validation. Here's how to use it well.
Ecto has no pagination module. Using limit/offset is simple but slows on deep pages. Keyset cursor pagination filters from the last seen row for stable, constant-time scrolling.
Ecto.Multi bundles multiple repo operations into one atomic transaction with named steps and structured errors. A worked example, plus the limits and mistakes that bite in practice.
Ecto.Multi models database transactions as explicit, composable data structures instead of callback blocks. This post walks through a registration pipeline, shows how steps share results via an accumulator, and explains why keeping side effects out of the transaction matters.
An architecture note on keyset (cursor) pagination in Ecto: when it beats OFFSET, the smallest working design, cursor trust boundaries, and the failure modes to test for.
Stop using fat models for validation. Learn how Ecto Changesets decouple data transformation from persistence to prevent mass-assignment vulnerabilities and handle race conditions.