new SequenceDiagram({
title: 'User.create()',
participants: [
{ name: 'App', kind: 'actor' },
{ name: 'Model', kind: 'object' },
{ name: 'Hooks', kind: 'object' },
{ name: 'Dialect', kind: 'object' },
{ name: 'Postgres', kind: 'database' },
],
messages: [
{ from: 'App', to: 'Model', label: 'create(values)', activate: true },
{ from: 'Model', to: 'Hooks', label: 'beforeValidate / beforeCreate' },
{ from: 'Model', to: 'Dialect', label: 'buildInsert(values)' },
{ from: 'Dialect', to: 'Postgres', label: 'INSERT … RETURNING *', activate: true },
{ from: 'Postgres', to: 'Dialect', label: 'row', return: true },
{ from: 'Model', to: 'Hooks', label: 'afterCreate' },
{ from: 'Model', to: 'App', label: 'instance', return: true },
],
}).generate()