2016-02-24 06:40:07 +01:00
|
|
|
package cmds
|
|
|
|
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
|
2016-02-24 09:53:34 +01:00
|
|
|
// init the "all" command
|
2016-02-24 06:40:07 +01:00
|
|
|
func init() {
|
|
|
|
SQLBoiler.AddCommand(allCmd)
|
|
|
|
allCmd.Run = allRun
|
|
|
|
}
|
|
|
|
|
|
|
|
var allCmd = &cobra.Command{
|
|
|
|
Use: "all",
|
|
|
|
Short: "Generate all templates from table definitions",
|
|
|
|
}
|
|
|
|
|
2016-02-24 09:53:34 +01:00
|
|
|
// allRun executes every sqlboiler command, starting with structs
|
2016-02-24 06:40:07 +01:00
|
|
|
func allRun(cmd *cobra.Command, args []string) {
|
|
|
|
err := outHandler(generateStructs())
|
|
|
|
if err != nil {
|
|
|
|
errorQuit(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
err = outHandler(generateDeletes())
|
|
|
|
if err != nil {
|
|
|
|
errorQuit(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
err = outHandler(generateInserts())
|
|
|
|
if err != nil {
|
|
|
|
errorQuit(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
err = outHandler(generateSelects())
|
|
|
|
if err != nil {
|
|
|
|
errorQuit(err)
|
|
|
|
}
|
|
|
|
}
|