Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

← Packs

data-model

VerifiedEnrichment0.6.1

Use 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.

    38 nodes24 typesneeds core

    Show the 38 nodes
    • Jobs listedacceptance-criterionacceptance-criterion-jobs-listed
    • Ops staffactoractor-ops-staff
    • happeneddata-attributeattr-event-happened
    • statedata-attributeattr-event-state
    • statedata-attributeattr-job-state
    • updateddata-attributeattr-job-updated
    • View job statuscapabilitycapability-view-job-status
    • happeneddata-columncol-event-happened
    • iddata-columncol-event-id
    • job_iddata-columncol-event-job
    • statedata-columncol-event-state
    • iddata-columncol-job-id
    • statedata-columncol-job-state
    • updateddata-columncol-job-updated
    • Ops APIcomponentcomponent-ops-api
    • Jobdata-conceptconcept-job
    • Job eventdata-conceptconcept-job-event
    • One event per job and momentdata-constraintconstraint-event-unique
    • opsdata-databasedatabase-ops
    • Ops dbdatastoredatastore-ops-db
    • Jobdata-entityentity-job
    • Job eventdata-entityentity-job-event
    • Productionenvironmentenvironment-production
    • Timely ops visibilitygoalgoal-timely-visibility
    • Live job statusincrementincrement-live-status
    • events by jobdata-indexindex-event-job
    • Job status agemetricmetric-status-freshness
    • Ops APIoverviewoverview
    • List jobsrequirementrequirement-list-jobs
    • publicdata-schemaschema-public
    • Managed Postgresdata-db-serverserver-ops
    • jobdata-tabletable-job
    • job_eventdata-tabletable-job-event
    • Devteamteam-dev
    • Platformteamteam-platform
    • latest_job_statusdata-viewview-latest-status
    • Build status APIwork-packagework-package-build-status-api
    • Provision databasework-packagework-package-provision-database

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-constrainsdata-constraint → data-table, data-columnA constraint applies to a table or to the columns it covers.
  • data-containsdata-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-fromdata-view → data-table, data-columnA view is built from tables or columns.
  • data-grantsdata-grant → data-database, data-schema, data-table, data-view, data-procA grant gives access to an object.
  • data-has-manydata-entity, data-table → data-entity, data-tableOne of these relates to many of those.
  • data-has-onedata-entity, data-table → data-entity, data-tableOne of these relates to exactly one of those.
  • data-holdsdata-user → data-grantA user holds a grant.
  • data-indexesdata-index → data-columnAn index covers a column.
  • data-realised-bydata-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-referencesdata-column → data-columnA foreign key: this column points at another column.
  • data-relates-toA 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-handleix_{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