Add schema feature to everything (except rels)
* Add strmangle SchemaTable helper
This commit is contained in:
parent
3929729a2c
commit
1c8a9d2e39
23 changed files with 88 additions and 60 deletions
2
main.go
2
main.go
|
@ -61,6 +61,7 @@ func main() {
|
|||
|
||||
// Set up the cobra root command flags
|
||||
rootCmd.PersistentFlags().StringP("output", "o", "models", "The name of the folder to output to")
|
||||
rootCmd.PersistentFlags().StringP("schema", "s", "public", "The name of your database schema, for databases that support real schemas")
|
||||
rootCmd.PersistentFlags().StringP("pkgname", "p", "models", "The name you wish to assign to your generated package")
|
||||
rootCmd.PersistentFlags().StringP("basedir", "b", "", "The base directory has the templates and templates_test folders")
|
||||
rootCmd.PersistentFlags().StringSliceP("exclude", "x", nil, "Tables to be excluded from the generated package")
|
||||
|
@ -108,6 +109,7 @@ func preRun(cmd *cobra.Command, args []string) error {
|
|||
cmdConfig = &Config{
|
||||
DriverName: driverName,
|
||||
OutFolder: viper.GetString("output"),
|
||||
Schema: viper.GetString("schema"),
|
||||
PkgName: viper.GetString("pkgname"),
|
||||
Debug: viper.GetBool("debug"),
|
||||
NoTests: viper.GetBool("no-tests"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue