How the ORM itself is put together — useful when finding your way around the source.The code#
new PackageDiagram({
title: 'prorm modules',
packages: [
{ name: 'models', members: [{ name: 'Model' }, { name: 'DataTypes' }] },
{ name: 'dialects', members: [{ name: 'Dialect' }, { name: 'PostgresDialect' }] },
{ name: 'nosql', members: [{ name: 'NoSqlStore' }, { name: 'MongoStore' }] },
],
dependencies: [{ from: 'models', to: 'dialects', label: 'compiles through' }],
}).generate()
What it produces#
Generated by running the snippet above — this is the generator's real output,
rebuilt by scripts/build-diagram-examples.mjs, not a picture of it.The stores deliberately do not depend on the dialects — they share only the connection lifecycle.Saving it#
generate() returns the SVG as a string; save(path) writes it straight to
disk.diagram.save('docs/schema.svg');
Models — the definitions these are drawn from Modified at 2026-10-04 00:40:16