Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GuessConstraints ¶
func GuessConstraints(indexes database.Indexes, primaryKeys database.PrimaryKeys, guessOptions ...GuessOption) []constraint.Constraint
GuessConstraints guesses foreign key constraints from primary keys and indexes. NOTE composite primary keys are not supported.
Types ¶
type GuessOption ¶
func GuessByPrimaryKey ¶
func GuessByPrimaryKey() GuessOption
Recongnize a column thats same name of other table's primary key is a foreign key This base idea refers to SchemaSpy DbAnalyzer:
https://github.com/schemaspy/schemaspy/blob/master/src/main/java/org/schemaspy/DbAnalyzer.java
func GuessByTableAndColumn ¶
func GuessByTableAndColumn() GuessOption
Recongnize a column thats same name without '_id' suffix of other table name is a foreign key
Click to show internal directories.
Click to hide internal directories.