gnormal / gnorm

A database-first code generator for any language
https://gnorm.org
Other
488 stars 40 forks source link

Added Bi-Directional Foreign Keys #63

Closed daniel-reed closed 6 years ago

daniel-reed commented 6 years ago

The foreign constraint database info is read into ForeignKey. Each column is provided with its foreign key definition.

Table exposes tables it references and other tables that reference it. Table also exposes all columns it owns that are foreign keys.

Column exposes both the other columns it references and other columns that reference it.

ForeignTable and ForeignColumn are used to hold both sides of the relationship. They also expose the name of the constraint and the names of the tables or columns it includes. These structs assist in serializing the relationships without recursion.

natefinch commented 6 years ago

SHIP IT