Skip to content
CAI
Software that uses CAICheck a score

agoodway/walex

68.7

Adequate · 18 September 2026

3.1k

lines of production code

Elixir

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

WalEx is an Elixir library that captures and processes PostgreSQL logical replication events using the pgoutput protocol. It provides a structured pipeline for decoding database changes, casting types, and dispatching events through a macro-based DSL for flexible handling. The system manages replication slots, connection supervision, and runtime configuration to ensure reliable change data capture.

How it got here

2021 — PostgreSQL adapter rewrite and dependency upgrade

7 changes.

The project removed its initial PostgreSQL logical replication implementation and replaced the epgsql driver with Postgrex, requiring an upgrade to Elixir 1.19. Internal data structures for change records and decoder messages were restructured to support explicit structs and new filtering capabilities, while quality tooling and security standards were introduced.

2023–2025 — Event processing and test infrastructure

12 changes.

This period focused on restructuring the replication architecture to introduce a structured event processing pipeline with a macro-based DSL for handling database changes. Significant effort was also dedicated to comprehensive test coverage for the new configuration, decoding, casting, and event handling modules, alongside automated development environment setup tools.

Features

Automated local PostgreSQL database setup for development

The development environment now includes a SQL script that automatically creates a superuser role and a dedicated 'todos\_test' database, streamlining the local setup process for developers by removing the need for manual database configuration.

dev · high confidence

Introduces per-application configuration store and registry

WalEx now uses a dedicated \WalEx.Config\ module backed by an Agent to store and manage per-application settings (such as database credentials, subscriptions, and modules) at runtime. This change introduces new configuration options including \durable\_slot\, \message\_middleware\, and \event\_relay\, and allows users to dynamically add, remove, or replace configuration values. A new \WalEx.Config.Registry\ provides a shared lookup mechanism for WalEx processes across the supervision tree, enabling better isolation and management of multiple WalEx instances.

lib/walex/config · high confidence

New Mix tasks to automate test database setup and teardown

Added \walex.setup\ and \walex.drop\ Mix tasks to streamline the local development environment. The setup task automatically creates the \todos\_test\ database, installs required extensions (citext, uuid-ossp), defines the \user\ and \todo\ tables with appropriate types (including arrays and JSONB), seeds them with sample data, and configures logical replication for the test suite. The drop task provides a convenient way to tear down this test database. Both tasks respect standard PostgreSQL environment variables (\PGHOST\, \PGUSER\, \PGPASSWORD\, \PGPORT\) for connection configuration.

lib/mix · high confidence

New PostgreSQL array and type casting modules

Added \WalEx.Casting.ArrayParser\ to parse PostgreSQL array literals (including nested arrays and NULL values) into Elixir lists, and \WalEx.Casting.Types\ to cast various PostgreSQL types (such as bool, int, float, numeric, timestamp, jsonb, and arrays) to their corresponding Elixir types.

lib/walex/casting · high confidence

New event processing DSL and structured event types

This change introduces a new macro-based DSL (\WalEx.Event.Dsl\) that allows host applications to define event handlers using \on\_insert\, \on\_update\, \on\_delete\, and \on\_event\ macros, which are installed via \use WalEx.Event\. It replaces the previous ad-hoc event handling with a structured \WalEx.Event\ struct that includes detailed source metadata (database, schema, table, columns) and a dedicated \WalEx.Event.Source\ module for attribution. The implementation supports asynchronous processing of events via \Task.start\ and provides filtering capabilities for unwatched records and fields.

lib/walex/event · high confidence

Removals

Removal of initial PostgreSQL WAL replication implementation

The \lib/wal\_ex\ directory has been cleared of its initial PostgreSQL logical replication codebase. This change removes the core components required for database change capture, including the \WalEx.Replication\ GenServer for processing WAL messages, the \WalEx.Adapters.Postgres.EpgsqlServer\ for managing the epgsql connection and replication slot, and the \WalEx.Adapters.Postgres.Decoder\ for parsing Postgres binary protocol messages. Additionally, the \WalEx.Supervisor\ and \WalEx.DatabaseReplicationSupervisor\ tree structures, along with supporting modules for event casting (\WalEx.Event\), type conversion (\WalEx.Types\), and change data structures (\WalEx.Adapters.Changes\), have been deleted, effectively removing the library's initial capability to listen to and decode database changes.

_lib/wal\ex · high confidence

Behavioural changes

Internal change record structures and filtering logic refactored

The internal representation of database changes has been restructured: \WalEx.Changes\ now defines explicit structs for \Transaction\, \NewRecord\, \UpdatedRecord\, \DeletedRecord\, and \TruncatedRelation\, replacing the previous adapter-based change models. Correspondingly, \WalEx.TransactionFilter\ has been updated to operate on these new structs, introducing new filtering capabilities such as \filter\_subscribed\, \filter\_changes\, and \filter\_unwatched\_fields\ to support column-level filtering and subscription management. The module also now derives \Jason.Encoder\ for all change structs, enabling direct JSON serialization of internal change records.

lib/walex · high confidence

New event processing pipeline and replication architecture

This change introduces a new event processing pipeline (\WalEx.Events\) and a restructured replication layer. The \Publisher\ now accumulates decoded \pgoutput\ messages into transactions and hands them off to the new \Events\ GenServer, which dispatches changes to configured processing modules. The replication \Server\ and \Publisher\ are now supervised together under a new \Replication.Supervisor\ using a \:one\_for\_all\ strategy to ensure state consistency between the LSN stream and the in-memory relation/type tables. Additionally, a \QueryBuilder\ module centralizes SQL and replication command strings, and the system now supports durable replication slots and configurable message middleware.

lib/walex/replication · high confidence

Removal of WalEx.hello/0 function

The public \hello/0\ function has been removed from the \WalEx\ module. Users relying on this function to return \:world\ will encounter a function not found error and must update their code to remove these calls.

lib · high confidence

Reworked decoder message structures and added daterange type support

The decoder now uses a new set of structs in \WalEx.Decoder.Messages\ to represent PostgreSQL logical replication events (such as \Begin\, \Commit\, \Insert\, \Update\, \Delete\, and \Truncate\), replacing the previous format and deprecating the \map\_diff\ approach. Additionally, the OID database has been updated to include support for the PostgreSQL \daterange\ type (OID 3912).

lib/walex/decoder · high confidence

Test coverage

Added shared test helpers for database and replication testing; Added tests for WalEx database replication and supervisor initialization; Added tests for array parsing and type casting logic; Added tests for event processing and error recovery; Added tests for the configuration and registry modules; Added unit tests for the WalEx decoder; Removed obsolete default test case.

Dependencies

Adds quality tooling and updates to version 4.8.0

The project now includes configuration files for Credo, Dialyzer, and Sobelow to enforce code quality and security standards, alongside a .tool-versions file specifying Erlang 28.4.1 and Elixir 1.19.5. The library version has been bumped to 4.8.0, and the README has been updated to reflect the new configuration structure, including support for runtime config updates and the new Event DSL.

(repo-wide) · high confidence

Upgrade to Elixir 1.19 and replace epgsql with Postgrex

WalEx now requires Elixir 1.19 and has replaced the epgsql driver with Postgrex (bumped to \>= 0.20.0), which also updates the dependency on the decimal library to \~\> 3.1. The project has added a suite of development and testing tools including Credo, Sobelow, Dialyxir, ExCoveralls, and Doctor, while removing older dependencies like Timex, map\_diff, and retry. This change updates the application version to 4.8.0 and configures the build to embed release information in production.

(dependencies) · high confidence

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

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 69.

Lenses

  • Code Health 99
  • Architecture 95
  • Maturity 60
  • Readiness 58
  • Security 97

Changes since last survey

  • 300 commits — 263 feature/other, 37 fixes

By area

  • (root) — 108 commits
  • lib/walex — 79 commits
  • test/walex — 49 commits
  • (repo) — 47 commits
  • .github/workflows — 8 commits
  • lib/mix — 6 commits
  • test/support — 2 commits
  • lib/wal_ex — 1 commit

Notable commits

  • fix: Fix config example
  • fix: Fix license.
  • fix: Fix postgresql array types parsing
  • fix: Fix readme
  • fix: Fix start and stop case statements.
  • fix: Fixes negative String slices warning
  • fix: Fixes: set up CI database - take 1.
  • fix: Fixes: set up CI database - take 10.
  • fix: Fixes: set up CI database - take 11.
  • fix: Fixes: set up CI database - take 2.
  • fix: Fixes: set up CI database - take 3.
  • fix: Fixes: set up CI database - take 4.
  • fix: Fixes: set up CI database - take 5.
  • fix: Fixes: set up CI database - take 6.
  • fix: Fixes: set up CI database - take 7.
  • fix: Fixes: set up CI database - take 8.
  • fix: Fixes: set up CI database - take 9.
  • fix: Merge branch 'master' into bug/event_macro
  • fix: Merge pull request #11 from kianmeng/fix-typos-and-markdowns
  • fix: Merge pull request #29 from cpursley/fixes
  • …and 280 more

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

Survey your own repository

agoodway/walex 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 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 08e9c38919b393376641470b75b9d55500754abc — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.