data-model
VerifiedEnrichment0.6.1Use when: When you need to say what is inside a datastore: the concepts, the entities and attributes, then the databases, schemas, tables, columns and indexes that realise them.
Concept to table in three layers: concepts, entities and attributes, then databases, schemas, tables, columns, indexes, constraints, views and grants. Seventeen rules keep the model honest, including that every foreign key points at one primary key of the same type and every relational datastore has a database.
Add it
Open it in trumly cloud to start a project with this pack already in. In an existing project, open the editor's Packs tab, choose data-model, then Add. Nodes you change after adding are kept when the pack is upgraded.
From a known source. Reviewed by us, and the publisher is known.
Explore is a read-only demo in your browser: nothing to sign in to, and nothing is saved.
- Namespace
dm--- Size
- 49 nodes
- Needs
- core@^1.0.0
- Works with
- links@^1.0.0
- Enriches
- datastore
- Publisher
- trumly
- Versions
0.6.1·0.6.0·0.5.0·0.4.0- Checksum
0cd292ed5957cd58…
Examples 1
- Jobs, concept to tableA starting point
Job and Job event as concepts, then entities and attributes, then the managed Postgres server, the ops database, tables, columns, a foreign key, an index, a constraint and a view.
Show the 38 nodes
- Jobs listed
acceptance-criterionacceptance-criterion-jobs-listed - Ops staff
actoractor-ops-staff - happened
data-attributeattr-event-happened - state
data-attributeattr-event-state - state
data-attributeattr-job-state - updated
data-attributeattr-job-updated - View job status
capabilitycapability-view-job-status - happened
data-columncol-event-happened - id
data-columncol-event-id - job_id
data-columncol-event-job - state
data-columncol-event-state - id
data-columncol-job-id - state
data-columncol-job-state - updated
data-columncol-job-updated - Ops API
componentcomponent-ops-api - Job
data-conceptconcept-job - Job event
data-conceptconcept-job-event - One event per job and moment
data-constraintconstraint-event-unique - ops
data-databasedatabase-ops - Ops db
datastoredatastore-ops-db - Job
data-entityentity-job - Job event
data-entityentity-job-event - Production
environmentenvironment-production - Timely ops visibility
goalgoal-timely-visibility - Live job status
incrementincrement-live-status - events by job
data-indexindex-event-job - Job status age
metricmetric-status-freshness - Ops API
overviewoverview - List jobs
requirementrequirement-list-jobs - public
data-schemaschema-public - Managed Postgres
data-db-serverserver-ops - job
data-tabletable-job - job_event
data-tabletable-job-event - Dev
teamteam-dev - Platform
teamteam-platform - latest_job_status
data-viewview-latest-status - Build status API
work-packagework-package-build-status-api - Provision database
work-packagework-package-provision-database
- Jobs listed
Patterns 1
Small fragments you lift into a project of your own. In the editor or through an agent, insert one under its root node.
- Starter data modelOne concept taken all the way to a table, with its entity, attribute, server, database, schema and key column. Add it for each thing you store, then rename and extend.Hangs from a
concept.
Planes 3
- Conceptual
- Logical
- Physical
Types 14
- data-attributeA logical attribute of an entity.
- data-columnA column of a table.
- data-conceptA business idea at the conceptual level: a thing the organisation talks about, with no structure yet.
- data-constraintA rule the database enforces on a table or columns: unique, check, not null or default.
- data-databaseA database on a server.
- data-db-serverA database server or instance that hosts databases.
- data-entityA logical entity: a thing with attributes and relationships, independent of any database.
- data-grantA permission given to a user on an object.
- data-indexAn index on one or more columns of a table.
- data-procA stored procedure or function.
- data-schemaA namespace of tables, views and procedures inside a database.
- data-tableA physical table.
- data-userA database user or role.
- data-viewA stored query presented as a table.
Link types 11
- data-constrains
data-constraint → data-table, data-columnA constraint applies to a table or to the columns it covers. - data-contains
data-db-server, data-database, data-schema, data-table, data-entity → data-database, data-schema, data-table, data-view, data-proc, data-column, data-index, data-constraint, data-attributeSomething sits inside another: a database in a server, a column in a table. - data-derives-from
data-view → data-table, data-columnA view is built from tables or columns. - data-grants
data-grant → data-database, data-schema, data-table, data-view, data-procA grant gives access to an object. - data-has-many
data-entity, data-table → data-entity, data-tableOne of these relates to many of those. - data-has-one
data-entity, data-table → data-entity, data-tableOne of these relates to exactly one of those. - data-holds
data-user → data-grantA user holds a grant. - data-indexes
data-index → data-columnAn index covers a column. - data-realised-by
data-concept, data-entity, data-attribute → data-entity, data-attribute, data-table, data-columnA higher level thing carried out one level down: concept to entity, entity to table, attribute to column. - data-references
data-column → data-columnA foreign key: this column points at another column. - data-relates-to
A loose relationship between any two things.
Calculated values 4
- column-handle
{^data-contains/title}.{title}A column is named by its table and its own title. - constraint-handle
{kind}_{data-constrains/title}A constraint is named by its kind and the table it constrains. - index-handle
ix_{data-indexes/^data-contains/title}_{data-indexes/title}An index is named ix, its table and the column it covers. - relation-handle
{title}A table or view is named by its title.
Rules 17
- WarningAttributes belong to one entity
- WarningColumns belong to one table
- InfoEvery concept becomes an entity
- WarningEvery constraint applies to something
- WarningDatabases run in servers
- WarningEvery database details a datastore in the design
- WarningEvery relational datastore has a database
- InfoEvery entity is built as a table
- WarningForeign key columns reference one primary key
- WarningEvery index covers a column
- WarningA table, view, index or constraint name fits PostgreSQL's 63-byte identifier limit
- WarningA column, schema or database name is at most 63 bytes
- WarningSchemas live in a database
- WarningTables live in a schema
- WarningEvery table has a primary key
- WarningEvery table realises an entity
- InfoEvery view is built from a table