Skip to content
CAI
Software that uses CAICheck a score

elixir-ecto/ecto

70.4

Strong · 13 November 2026

33.2k

lines of production code

Elixir

primary language

8

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Ecto 'Friends' example application

A new sample application named 'Friends' has been added to the examples directory to demonstrate Ecto usage. This includes the necessary project structure, configuration for a PostgreSQL database, a migration to create a 'people' table, seed data, and basic tests, providing a reference implementation for users following the Ecto getting started guide.

examples · high confidence

Complete rewrite of the query builder into a modular, namespaced architecture

The query builder logic has been restructured from a monolithic implementation into a set of dedicated, namespaced modules under \Ecto.Query.Builder\ (e.g., \Combination\, \CTE\, \Distinct\, \Dynamic\, \Filter\, \From\, \GroupBy\, \Join\, \LimitOffset\, \Lock\, \OrderBy\, \Preload\, \Select\). This change introduces support for new SQL features including Common Table Expressions (CTEs) with materialization options, window functions with frame clauses, lateral joins, query combinations (UNION/INTERSECT/EXCEPT), and dynamic query interpolation. It also enhances the \select\ clause to support map and struct updates, subqueries, and the \selected\_as\ API, while enforcing stricter validation for locks, prefixes, and join sources to improve security and error reporting.

lib/ecto/query/builder · high confidence

Initial project scaffolding and documentation

This change establishes the initial repository structure for Ecto, adding the Apache 2.0 license, a comprehensive README with installation and usage examples, and a detailed changelog for the v3.x series. It also introduces a \.formatter.exs\ configuration file to standardize code formatting for Ecto's DSL macros (such as \from\, \field\, and association definitions) and updates the \.gitignore\ to exclude build artifacts like \\_build\ and \doc\.

(repo-wide) · high confidence

Introduce Friends example application

The friends example application has been added to the repository, providing a starter project that demonstrates an OTP application structure with a PostgreSQL-backed repository using Ecto. The example includes a basic schema for managing people records and a supervisor tree to manage the application's lifecycle.

examples/friends · high confidence

New Ecto Mix tasks for repository management and generation

This change introduces dedicated Mix tasks for Ecto repository operations: \mix ecto.create\ and \mix ecto.drop\ now support explicit \-r\/\--repo\ flags to target specific repositories, along with \--quiet\, \--no-compile\, and \--no-deps-check\ options. The \mix ecto.drop\ task adds a \--force-drop\ flag to bypass connection checks (requiring PostgreSQL 13+). A new \mix ecto.gen.repo\ generator creates repository modules and updates configuration files, while \mix ecto\ provides a help interface listing available Ecto tasks.

lib/mix/tasks · high confidence

New Ecto associations and CRUD cheatsheets added to guides

Added new reference documentation for Ecto in the \guides/cheatsheets\ directory. The \associations.cheatmd\ file provides examples for \has\_many\, \has\_one\, and \many\_to\_many\ relationships, including schema definitions and corresponding Ecto migrations. The \crud.cheatmd\ file covers basic Create, Read, Update, and Delete operations, demonstrating record fetching, querying (keyword and pipe-based), and inserting/updating/deleting records using both internal and external data with changesets.

guides/cheatsheets · high confidence

New Mix.Ecto module for Ecto task conveniences

A new \Mix.Ecto\ module has been introduced to provide shared utilities for Ecto-related Mix tasks. This includes \parse\_repo\ to handle repository configuration via command-line flags or application environment, \ensure\_repo\ to validate and load repository modules, and \open?\ to support file and line interpolation for the \ECTO\_EDITOR\ environment variable. It also adds \no\_umbrella!\ to prevent running specific tasks from umbrella project roots and \ensure\_implements\ for behavior validation.

lib/mix · high confidence

Architecture

New Ecto.Query submodules for API, Builder, Planner, and Window functions

Ecto.Query has been refactored into distinct modules: Ecto.Query.API (documentation-only query expressions), Ecto.Query.Builder (expression escaping and AST construction), Ecto.Query.Planner (query normalization, caching, and adapter preparation), Ecto.Query.Inspect (human-readable query printing), and Ecto.Query.WindowAPI (window function definitions). This restructuring separates query building, planning, and inspection logic, improving maintainability and clarity of the query pipeline without changing the public query DSL.

lib/ecto/query · high confidence

Refactor Ecto.Repo into modular components

The monolithic Ecto.Repo implementation has been split into distinct modules to improve organization and maintainability. New modules include Ecto.Repo.Assoc for association loading, Ecto.Repo.Preloader for handling preloads and parallel execution, Ecto.Repo.Queryable for standard query operations (all, get, reload, aggregate, exists?), Ecto.Repo.Schema for schema-based operations like insert\_all, Ecto.Repo.Transaction for transaction management, Ecto.Repo.Registry for tracking running repo processes, and Ecto.Repo.Supervisor for repository supervision and URL parsing. This refactoring separates concerns while preserving the existing public API surface.

lib/ecto/repo · high confidence

Behavioural changes

10 commits (2 fixes) modifying lib/ecto/pools/sojourn\_broker

A change to existing behaviour in lib/ecto/pools/sojourn\_broker — 10 commits (2 fixs), 4 files. Also in this area: 1 commit (0 fixes) modifying lib/ecto; 5 commits (1 fix) modifying lib/ecto; Parallel preloading now requires multiple schedulers; Clarified type specs for quoted types and join escaping, and updated redaction documentation; Improved handling of negative years and malformed datetimes without seconds; and 1 more.

lib/ecto · low confidence · unverified

Ecto.Adapter split into specialized behaviors

The monolithic Ecto.Adapter behavior has been split into four distinct modules: Ecto.Adapter.Queryable (handling query preparation, execution, and streaming), Ecto.Adapter.Schema (handling schema-level operations like insert, update, delete, and insert\_all), Ecto.Adapter.Storage (handling storage lifecycle callbacks like storage\_up, storage\_down, and the new storage\_status), and Ecto.Adapter.Transaction (handling transaction execution and status). This refactoring allows adapters to implement only the specific capabilities they support, rather than being forced to implement the entire adapter interface.

lib/ecto/adapter · high confidence

Introduce Ecto.Changeset.Relation for association and embed handling

This change introduces a new \Ecto.Changeset.Relation\ module to centralize the logic for casting, changing, and applying updates to associations and embedded schemas. By extracting this behavior into a dedicated module, the library now supports more consistent handling of nested relations, including features like \on\_replace\ strategies, primary key validation, and support for both structs and maps in \put\_assoc\/\put\_embed\. This refactoring improves the robustness of nested data manipulation and error reporting for users working with complex schemas.

lib/ecto/changeset · high confidence

Refactor schema data loading and introduce Metadata struct

The schema loading logic has been extracted into a new \Ecto.Schema.Loader\ module, which now handles loading structs and data from user/embeds sources, including pretty-printing fragment tuples in the source metadata. A new \Ecto.Schema.Metadata\ struct has been added to explicitly store schema state (\:built\, \:loaded\, \:deleted\), source, prefix, and context, with a custom \Inspect\ implementation for clearer debugging output. This refactoring separates the concerns of data transformation from schema definition, improving the clarity and maintainability of how Ecto handles struct initialization and data persistence metadata.

lib/ecto/schema · high confidence

Test coverage

Added comprehensive test coverage for query builder components; Added comprehensive test suites for Ecto core components; Added comprehensive test suites for Ecto.Query builder, planner, and subqueries; Added test coverage for belongs\_to, has\_one, has\_many, many\_to\_many, and embedded schema changesets; Added test support helpers and mock adapters; Added tests for Ecto Mix tasks; Added tests for Mix.Ecto helper functions; Expanded test coverage for Ecto Repo operations; Expanded test coverage for Ecto.assoc prefix behavior and Ecto.reset\_fields; Integration test schemas and types updated for new Ecto features; New integration test suite for Ecto core features.

Dependencies

488 commits updating dependencies (8 manifests)

A dependency / build maintenance change in (dependencies) — 488 commits (17 fixs), 8 files.

(dependencies) · medium confidence · unverified

Housekeeping

Comprehensive Ecto overview documentation added to main module

The \lib/ecto.ex\ module now includes extensive documentation outlining the four main components of Ecto: Repositories, Schemas, Queries, and Changesets. This addition provides users with a high-level conceptual guide, including code examples for defining a repository, creating a schema, and building a changeset, effectively serving as a central entry point for understanding how these components interact.

lib · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 68 → 70 (+2.8)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 95 → 95 (+0.0)
  • Architecture 84 → 94 (+9.8)
  • Maturity 58 → 61 (+3.0)
  • Readiness 63 → 63 (+0.0)
  • Security 100 → 100 (+0.4)

Resolved (4)

  • Change coupling: distinct.ex ↔ group_by.ex (lib/ecto/query/builder/distinct.ex)
  • Documentation: no architecture or design documentation
  • Off-boarding risk: anonymized user #1
  • Projects may be oversized for their cohesion

New (36)

  • Edited copies of one member (3 members, 3+ corresponding lines) (lib/ecto/query/builder/distinct.ex)
  • Edited copies of one member (4 members, 11+ corresponding lines) (lib/ecto/query/builder/distinct.ex)
  • Edited copies of one member (4 members, 3+ corresponding lines) (lib/ecto/query/builder/distinct.ex)
  • Edited copies of one member (5 members, 1+ corresponding lines) (lib/ecto/association.ex)
  • Edited copies of one member (5 members, 3+ corresponding lines) (lib/ecto/query/builder.ex)
  • Edited copy of a member (1 corresponding lines) (lib/ecto/query/builder.ex)
  • Edited copy of a member (1 corresponding lines) (lib/ecto/query/builder.ex)
  • Edited copy of a member (1 corresponding lines) (lib/ecto/query/builder/group_by.ex)
  • Edited copy of a member (10 corresponding lines) (lib/ecto/embedded.ex)
  • Edited copy of a member (10 corresponding lines) (lib/ecto/query/builder/preload.ex)
  • Edited copy of a member (10 corresponding lines) (lib/ecto/query/planner.ex)
  • Edited copy of a member (10 corresponding lines) (lib/ecto/type.ex)
  • Edited copy of a member (11 corresponding lines) (lib/ecto/query.ex)
  • Edited copy of a member (12 corresponding lines) (lib/ecto/embedded.ex)
  • Edited copy of a member (16 corresponding lines) (lib/ecto/repo/queryable.ex)
  • Edited copy of a member (18 corresponding lines) (lib/ecto/schema.ex)
  • Edited copy of a member (2 corresponding lines) (lib/ecto/encrypted.ex)
  • Edited copy of a member (2 corresponding lines) (lib/ecto/query/builder.ex)
  • Edited copy of a member (2 corresponding lines) (lib/ecto/query/builder/group_by.ex)
  • Edited copy of a member (25 corresponding lines) (lib/ecto/repo/preloader.ex)
  • …and 16 more

Changes since last survey

  • 11 commits — 10 feature/other, 1 fixes

By area

  • lib/ecto — 10 commits
  • (root) — 1 commit

Notable commits

  • fix: Fix CI
  • change: Add Ecto.Encrypted and Ecto.HMAC (#4814)
  • change: Correct documentation for empty_values in Changeset.validate_required/3 (#4810)
  • change: Do not cache queries with interpolated JSON paths, splices, and constants
  • change: Keep prefix and hints of interpolated join queries
  • change: Keep the data type through Changeset functions (#4813)
  • change: Redact fields in Ecto.InvalidChangesetError and mixed keys CastError messages
  • change: Remove redundant escape/5 clause
  • change: Small documentation improvements for Ecto.HMAC (#4815)
  • change: Store query expression files relative to the current directory (#4811)
  • change: Update CHANGELOG

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

elixir-ecto/ecto was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 0e31befcada8660dc622884199f4418494d73bac — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.57+preprod-8ebfb01cf4c0.