Nyoman Abiwinandablog.abiwinanda.com·Nov 10, 2024Solving Data Consistency in Elixir with Ecto's prepare_changesWhen developing an application, it's common for the state of one piece of data to depend on the state of another. This interdependence introduces complexity, as changes in one dataset must remain consistent with changes in others to avoid conflicts o...Elixir
Shawn Condonshwncndn.hashnode.dev·Sep 10, 2024Phoenix Deconstructed : Login and Registration Request LifecycleThis post will explore the Phoenix Web Framework's HTTP request lifecycle within the authentication flow of an example web application. Phoenix provides authentication logic generators to help us scaffold a solution quickly and early in our project. ...28 readsPhoenix DeconstructedPhoenix framework
Stephan Yustephanyu.hashnode.dev·Mar 13, 2024Ecto vs ActiveRecordIn this post, I am going to take a look at Ecto, a data mapping and database query library designed to provide seamless integration between Elixir code and database operations and compare it to Ruby on Rail's ActiveRecord. Ecto and ActiveRecord are b...Elixir
Pau Riosapaugramming.com·Feb 19, 2024Things I Learned using Ecto.Schema in 2024 (Part 1)The problem I have two schemas, coffees and orders wherein I want to get the recent completed order from each coffees First solution defmodule Schemas.Coffee do # ... more code has_many :completed_orders, Schemas.Order @spec coffee_query...44 readsElixir
Maqboolwww.maqbool.net·Sep 9, 2023Create a sorted Index in Ectodefmodule MyApp.Repo.Migrations.AddMessagesInsertedAtIndex do use Ecto.Migration @disable_ddl_transaction true @disable_migration_lock true def change do create index("messages", ["inserted_at DESC"], concurrently: true) end end if y...96 readsToday I learned ecto
John Wilgerjohnwilger.com·Feb 16, 2020Complex Unique Constraints with PostgreSQL Triggers in EctoEcto makes it easy to work with typical uniqueness constraints in your database; you just define your table like this: defmodule MyApp.Repo.Migrations.CreateFoos do use Ecto.Migration def change do create table(:foos) do add :name, :te...63 readsecto