Skip to content
This repository was archived by the owner on Oct 28, 2020. It is now read-only.

Concepts

Kasper Laukamp edited this page Mar 6, 2020 · 2 revisions

The following are the base concepts/lingo used in Pipe Dream

File Factory

A File Factory is an npm module that has Pipes and Templates. File Factories are what converts the Schema into separate files, ready to be saved to disk.

Pipe

A Pipe receives the Schema and will then with the help of Templates generate a list of files that are then sent to the a File Factory

Template

A Template is a raw text file that has placeholders (typically identified by being ALL CAPS and are prefixed and suffixed by three (3) underscores (_), e.g ___MODEL_NAME___). A Pipe can overwrite these placeholders with values directly from the Schema, or calculate values based on whatever the File Factory developer wants.

Segment

A Segment is the part of a sketch that signifies an Entity. Each Segment is identified by having a trailing double line break (\n\n)

e.g

Car
isFast

User
isAdmin

The above Sketch has 2 Segments: Car and User, in this case these are a Model and UserModel respectively. A Segment can also be just a single table.

Schema

The Schema is an object that holds a deserialized version of your sketch. Here you can see all typecasts, uniqueness of each database field, nullability etc.

Sketch

The Sketch is the main part of Pipe Dream. This is where you describe your application which will then be converted into a Schema, which will then be fed to each File Factory you have installed. Read more here

Entity

An Entity is a deserialized Segment from your Sketch. Entities can be one of four types:

  • UserModel
  • Model
  • PivotTable
  • Table

The inheritance of each Entity are as follows:
UserModel extends Model
Model extends Table
PivotTable extends Table

Clone this wiki locally