sqlboiler/strmangle/testmangle.go
Aaron L f46c2c5337 Add relationship "to_one" template.
- Temporarily add some new helper functions, going to clean these all
  up in favor of pipes
- Annotate a couple of super weird methods
- Fix a printf verb for err
2016-06-19 16:01:22 -07:00

26 lines
637 B
Go

package strmangle
import (
"fmt"
"strings"
"github.com/nullbio/sqlboiler/dbdrivers"
)
// RandDBStruct does nothing yet
// TODO(nullbio): What is this?
func RandDBStruct(varName string, table dbdrivers.Table) string {
return ""
}
// RandDBStructSlice randomizes a struct?
// TODO(nullbio): What is this?
func RandDBStructSlice(varName string, num int, table dbdrivers.Table) string {
var structs []string
for i := 0; i < num; i++ {
structs = append(structs, RandDBStruct(varName, table))
}
innerStructs := strings.Join(structs, ",")
return fmt.Sprintf("%s := %s{%s}", varName, TitleCasePlural(table.Name), innerStructs)
}