Newer
Older
pokemon-go-trade / vendor / github.com / go-pg / pg / orm / inflection.go
Simon Lindgren on 12 Feb 2021 378 bytes first commit
package orm

import (
	"github.com/jinzhu/inflection"
)

var tableNameInflector func(string) string

func init() {
	SetTableNameInflector(inflection.Plural)
}

// SetTableNameInflector overrides the default func that pluralizes
// model name to get table name, e.g. my_article becomes my_articles.
func SetTableNameInflector(fn func(string) string) {
	tableNameInflector = fn
}