2019-12-25 07:24:30 +01:00
|
|
|
package psql
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
func (rt RelType) String() string {
|
|
|
|
switch rt {
|
|
|
|
case RelOneToOne:
|
|
|
|
return "one to one"
|
|
|
|
case RelOneToMany:
|
|
|
|
return "one to many"
|
|
|
|
case RelOneToManyThrough:
|
|
|
|
return "one to many through"
|
|
|
|
case RelRemote:
|
|
|
|
return "remote"
|
2020-01-28 06:26:53 +01:00
|
|
|
case RelEmbedded:
|
|
|
|
return "embedded"
|
2019-12-25 07:24:30 +01:00
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (re *DBRel) String() string {
|
|
|
|
return fmt.Sprintf("'%s.%s' --(%s)--> '%s.%s'",
|
|
|
|
re.Left.Table, re.Left.Col, re.Type, re.Right.Table, re.Right.Col)
|
|
|
|
}
|