new SchemaDocDiagram({
title: 'users',
tables: [{
name: 'users',
comment: 'People who can sign in',
columns: [
{ name: 'id', type: 'INTEGER', key: 'PK', description: 'Surrogate key' },
{ name: 'email', type: 'VARCHAR(255)', key: 'UQ', description: 'Login identity' },
{ name: 'name', type: 'VARCHAR(100)' },
{ name: 'orgId', type: 'INTEGER', key: 'FK', nullable: true,
description: 'Owning organisation' },
],
}],
}).generate()scripts/build-diagram-examples.mjs, not a picture of it.generate() returns the SVG as a string; save(path) writes it straight todiagram.save('docs/schema.svg');