Dore generates fake data for models of schemas by generating fake data for each of its attributes and combining them
to form records.
In order for Dore to generate value for an attribute, we need to configure details in the attribute using the
value object which defines how Dore generates value for it.
The Value Definition of an attribute should specify an
Attribute Value Generator, along with any parameters that it might
need, that Dore will use to generate values for the attribute.
Let's define value configs for each of the attributes we created in the previous section.
Customer Model
This section contains details of value definitions for attributes of the customer model.
customerId
Since each customer ID needs to be a unique string, we can use UUID values for the customer_id column.
Dore supports various
Attribute Value Generators
that you can use to define how value for a particular attribute should to be generated.
In order to generate UUID values, we can use the
Faker Value Generator. Let's provide the value definition
for customerId attribute to indicate that Dore should generate UUID values for this
column using the Faker Value Generator:
For generating random names, we can use the Faker Value Generator
again and use the name method. Let's add the value definition for customerName attribute to our manifest:
Based on the ecommerce schema, The customer_id column of the Order table is a
Foreign Key which references the customer_id column of the Customer table.
You can use the Ref Value Generator to define that Dore should
generate values for an attribute by deriving its values of from values of another attribute. Such attributes are also
known as Dependent Attributes.
Since the value of order.customerId attribute is dependent on customer.customerId attribute, we can add value
definition for order.customerId as follows: