Core Concepts
Core concepts
The DB session model, the Statement and its clause registry, Config, and per-call sessions.
Everything in fusion-orm flows through a few small, sharply-defined types:
*DB— a session handle. The root instance fromOpen, or a derivative produced by chaining,Session,WithContext,Debug, orBegin. Copy-on-write all the way down.Statement— the per-chain state: clauses, model, destination, vars, plugin settings, and a typed 16-slot clause registry with a canonical build order.Config— session-wide settings, copied (never shared) onto every derivative, so session flags cannot leak back to the root.Session/WithContext/Debug— the per-call dials you turn on a derivative: dry-run mode, context cancellation, verbose logging, and friends.
Start with the session if you're new — every other piece is reached through it.
The DB session
Root vs derivatives, the two-field finisher contract, and the error slot.
Chaining & copy-on-write
Why every chainable returns a new *DB and nothing mutates the receiver.
Statement
The clause registry, the 16-slot build order, and plugin settings.
Config reference
Every Config field, with type and meaning.
Sessions & context
Session, WithContext, Debug — what each clones and when to use it.