SDV icon indicating copy to clipboard operation
SDV copied to clipboard

Additional options for primary and foreign keys

Open csala opened this issue 5 years ago • 0 comments

Problem Description

Current SDV implementation only supports individual column keys of type integer and string.

We should extend this to support other options such as key values of other types (float and datetime) or composite keys (multiple columns that uniquely identify each row when put together).

This should work for both single table and multi table models, which means also adding the possibility to specify table relationships based on composite keys.

Expected behavior

Metadata

id field subtypes should be extended to add other options. Specifying a relationship based on multiple fields, including fields of which are not of type id should also be possible.

Single Table Models

The primary_key argument (or corresponding metadata field) should accept a list of field names instead of just a string, and when the data is generated the combination of values of the indicated columns must be guaranteed to be unique.

Multi Table Models

The multi-table models should be adapted to support the relationships defined via composite keys in the Metadata.

csala avatar Mar 24 '21 16:03 csala