MCPcopy Create free account
hub / github.com/cloudwan/gohan / foreignKeyName

Function foreignKeyName

db/sql/sql.go:302–309  ·  view source on GitHub ↗
(fromTable, fromProperty, toTable, toProperty string)

Source from the content-addressed store, hash-verified

300}
301
302func foreignKeyName(fromTable, fromProperty, toTable, toProperty string) string {
303 name := fmt.Sprintf("%s_%s_%s_%s", fromTable, fromProperty, toTable, toProperty)
304 if len(name) > 64 {
305 diff := len(name) - 64
306 return name[diff:]
307 }
308 return name
309}
310
311func (db *DB) measureTime(timeStarted time.Time, action string) {
312 metrics.UpdateTimer(timeStarted, "db.%s", action)

Callers 1

genTableColsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected