guess

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 4 Imported by: 0

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

type GuessOption func(database.Column, string, database.Column) bool

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL