Skip to content

Reframe the roadmap around the DDD pivot - #9

Merged
m13m merged 2 commits into
masterfrom
docs/roadmap-phase-3
Oct 30, 2026
Merged

m13m merged 2 commits into
masterfrom
docs/roadmap-phase-3

Conversation

@m13m

@m13m m13m commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Two commits, roadmap only. The first brings it up to date with phases 2 and 3 — it was committed onto the #8 branch but did not reach master, since #8 merged while it was being amended. The second reframes it around the pivot.

Nothing in lib/ changes. This is the plan for review before any of it is built.

What the pivot section says

It separates three things rather than presenting the restructure as uniformly valuable:

Genuinely new

  • An explicit connection state machine, so illegal operations are unrepresentable. "A resultset is half-read, do not send another command" is a real invariant that nothing currently enforces, and it stops being theoretical once cursors exist.
  • A query context — a composable query value plus a compiler to SQL. The substance of the pivot.
  • ssl.ex behind the transport behaviour, which also unblocks caching_sha2_password's full authentication path.

Mostly renaming

  • protocol/ → wire/, client.ex → connection/connection.ex. Worth doing while the code is small; it buys vocabulary, not correctness.

Deliberately not adopted

  • Repositories — this is the persistence mechanism.
  • Domain events — a strict request/response protocol with no subscribers does not need them, and per-row events in a resultset would be actively harmful.
  • Service layers over functions that are already one-liners.

Reordered phases

A. Finish the text resultset   ← next, and unchanged in position
B. Restructure
C. The query layer
D. Prepared statements
E. Authentication and TLS      ← can float earlier
F. Reduce db_connection to pooling
G. Session and utility commands
H. Replication

The resultset stays first for a practical reason: every layer above it needs something to read, and a query language on a driver that cannot SELECT cannot be validated end to end.

The question to settle

Does the compiler emit SQL with interpolated literals, or SQL with placeholders plus a parameter list? Placeholders need prepared statements to execute, so the query layer would land as compile-and-inspect before it becomes compile-and-execute. It is also the only version that is not an injection hole. Stated intent is placeholders — worth your explicit agreement, since it sets the order of C and D.

Dropped

The Ecto.Adapters.SQL adapter, as a destination. The pivot builds that layer directly. Still possible — the driver would satisfy one — but no longer what this aims at.

Also recorded

The current CRUD position, plainly: three letters of four, no parameter binding and no escaping helper, so values must be interpolated by hand. And that CI does not prove the login, since the workflow has no MySQL service.

m13m added 2 commits October 30, 2026 14:30
Records what actually works — connect, authenticate, run any statement
returning no rows — with the shape of the calls rather than a claim, and
that SELECT is still refused rather than guessed at.

Ticks phase 2 up to the point reached and names what is left in it, with
why a modern server at default settings cannot be reached until
caching_sha2_password lands.

Keeps the auth-switch finding, since it is the one correction a real
server made to a design the fake had happily confirmed.

Also states plainly that CI does not prove the login: the workflow has
no MySQL service, so a green check means the parsers agree with the spec
and the fixtures, nothing more.
Adds a "pivot" section separating what the restructure genuinely buys
from what is renaming, and what is deliberately not adopted — no
repositories, no domain events, no service layers over one-liners — with
the reason in each case.

Reorders the phases. The text resultset stays first, because every layer
above it needs something to read and because it is the largest body of
logic left. Then the restructure, then the query layer, then prepared
statements, which is where a query compiled to placeholders becomes
executable rather than only inspectable.

Records the open question the query layer turns on: placeholders or
interpolated literals. Placeholders need prepared statements and are the
only version that is not an injection hole, so the intent is
placeholders, landing before anything can run them.

Drops the Ecto adapter as a destination, since the pivot builds that
layer directly. Still possible, no longer the aim.

Also states the current CRUD position plainly: three letters of four,
with no parameter binding and no escaping helper, which is what the query
layer plus prepared statements exist to close.
@m13m m13m changed the title Bring the roadmap up to date with phases 2 and 3 Reframe the roadmap around the DDD pivot Oct 30, 2026
@m13m
m13m merged commit 3253189 into master Oct 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant