-
Notifications
You must be signed in to change notification settings - Fork 110
Concepts
The following are the base concepts/lingo used in Pipe Dream
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.
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
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.
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.
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.
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
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