Writing config files
Configuration files overview
The Prequel data model is configured via a JSON file with a specific format. If no model_name
is provided, the name of the file (not including the extension) will be the name used for the table in the destination database. For example, for the configuration below, the destination table will appear as logs
.
{
"model_name": "logs",
"columns": [
{
"name_in_source": "id",
"name_in_destination": "id",
"data_type": "text",
"is_primary_key": true
},
{
"name_in_source": "log",
"name_in_destination": "event_log",
"description":"A descriptive text entry of the event that occured.",
"data_type": "text"
},
{
"name_in_source": "updated_at",
"name_in_destination": "updated_at",
"data_type": "timestamp",
"is_last_modified": true
}
],
"source_table": "source_schema.application_logs",
"source_name": "Example Production Source",
"organization_column": "organization_id"
}
Configuration file keys
Each configuration file has 6 top level config keys: (3 required) columns
, source_table
, and organization_column
, and (3 optional) model_name
, description
, and source_name
.
Config file keys
Config Key | Required | Description |
---|---|---|
| Name of table to be loaded into the destination. If left blank, the file name (not including file extension) will be used. | |
| Table description. Will be applied to destination tables if provided. | |
| ✅ | A list of all destination columns (for this destination table). This is used to These columns are also used to create the
|
| ✅ | Specifies the name of the source table to be queried. |
| Specifies the source from which this model should read data. This field is only required if multiple sources exist in the account. If left blank and only one source exists, models will read from that source by default. | |
| ✅ | Specifies the column that will be used for filtering data by organization. Because this column is not necessarily a column that you want to transfer to users, it is not required within the |
Column object keys
Column object key | Required | Description |
---|---|---|
| ✅ | |
| ✅ | |
| ✅ | |
| (On exactly one column) | |
| (On exactly one column) | |
|
Using Acceptable TypesIt is important to use the correct
data_type
for each column to ensure compatibility with all destinations. Refer to the Data Types documentation for the complete list of supported types.
By default, every destination you add to Prequel will be sent all the models defined in the prequel/models
directory. Products allow you to only send a subset of those models to destinations.
Updated 9 days ago