@@ -293,16 +293,7 @@ func remoteGenerate(ctx context.Context, configPath string, conf *config.Config,
293293 return output , nil
294294}
295295
296- // parseResult indicates the outcome of parsing a SQL configuration
297- type parseResult int
298-
299- const (
300- parseSuccess parseResult = iota
301- parseFailed
302- parseSkipped // Configuration was skipped (e.g., database unavailable)
303- )
304-
305- func parse (ctx context.Context , name , dir string , sql config.SQL , combo config.CombinedSettings , parserOpts opts.Parser , stderr io.Writer ) (* compiler.Result , parseResult ) {
296+ func parse (ctx context.Context , name , dir string , sql config.SQL , combo config.CombinedSettings , parserOpts opts.Parser , stderr io.Writer ) (* compiler.Result , bool ) {
306297 defer trace .StartRegion (ctx , "parse" ).End ()
307298 c , err := compiler .NewCompiler (sql , combo , parserOpts )
308299 defer func () {
@@ -311,15 +302,8 @@ func parse(ctx context.Context, name, dir string, sql config.SQL, combo config.C
311302 }
312303 }()
313304 if err != nil {
314- // Check if this is a database unavailability error (e.g., missing env var)
315- // In this case, skip the configuration gracefully rather than failing
316- if compiler .IsDatabaseUnavailable (err ) {
317- fmt .Fprintf (stderr , "# package %s\n " , name )
318- fmt .Fprintf (stderr , "skipping: %s\n " , err )
319- return nil , parseSkipped
320- }
321305 fmt .Fprintf (stderr , "error creating compiler: %s\n " , err )
322- return nil , parseFailed
306+ return nil , true
323307 }
324308 if err := c .ParseCatalog (sql .Schema ); err != nil {
325309 fmt .Fprintf (stderr , "# package %s\n " , name )
@@ -330,7 +314,7 @@ func parse(ctx context.Context, name, dir string, sql config.SQL, combo config.C
330314 } else {
331315 fmt .Fprintf (stderr , "error parsing schema: %s\n " , err )
332316 }
333- return nil , parseFailed
317+ return nil , true
334318 }
335319 if parserOpts .Debug .DumpCatalog {
336320 debug .Dump (c .Catalog ())
@@ -344,9 +328,9 @@ func parse(ctx context.Context, name, dir string, sql config.SQL, combo config.C
344328 } else {
345329 fmt .Fprintf (stderr , "error parsing queries: %s\n " , err )
346330 }
347- return nil , parseFailed
331+ return nil , true
348332 }
349- return c .Result (), parseSuccess
333+ return c .Result (), false
350334}
351335
352336func codegen (ctx context.Context , combo config.CombinedSettings , sql OutputPair , result * compiler.Result ) (string , * plugin.GenerateResponse , error ) {
0 commit comments