@@ -37,6 +37,7 @@ func Do(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int
3737 rootCmd .PersistentFlags ().StringP ("file" , "f" , "" , "specify an alternate config file (default: sqlc.yaml)" )
3838 rootCmd .PersistentFlags ().BoolP ("experimental" , "x" , false , "DEPRECATED: enable experimental features (default: false)" )
3939 rootCmd .PersistentFlags ().Bool ("no-remote" , false , "disable remote execution (default: false)" )
40+ rootCmd .PersistentFlags ().Bool ("no-database" , false , "disable database connections (default: false)" )
4041
4142 rootCmd .AddCommand (checkCmd )
4243 rootCmd .AddCommand (diffCmd )
@@ -133,18 +134,21 @@ var initCmd = &cobra.Command{
133134}
134135
135136type Env struct {
136- DryRun bool
137- Debug opts.Debug
138- NoRemote bool
137+ DryRun bool
138+ Debug opts.Debug
139+ NoRemote bool
140+ NoDatabase bool
139141}
140142
141143func ParseEnv (c * cobra.Command ) Env {
142144 dr := c .Flag ("dry-run" )
143145 nr := c .Flag ("no-remote" )
146+ nodb := c .Flag ("no-database" )
144147 return Env {
145- DryRun : dr != nil && dr .Changed ,
146- Debug : opts .DebugFromEnv (),
147- NoRemote : nr != nil && nr .Value .String () == "true" ,
148+ DryRun : dr != nil && dr .Changed ,
149+ Debug : opts .DebugFromEnv (),
150+ NoRemote : nr != nil && nr .Value .String () == "true" ,
151+ NoDatabase : nodb != nil && nodb .Value .String () == "true" ,
148152 }
149153}
150154
0 commit comments