inject mongodb uri inside the binary and os

This commit is contained in:
Robin Olsen
2026-03-13 12:33:09 +01:00
parent 286d8cf51d
commit e23d0155df
5 changed files with 32 additions and 3 deletions

View File

@@ -22,6 +22,10 @@ var SubmitCmd = &cobra.Command{
return nil
}
if !cmd.Flags().Changed("dev") {
fmt.Println("DBUri", app.Config.DbUri)
}
db, err := storage.NewMongoStorageInteractive(cmd.Context(), app.Config.DbUri)
if err != nil {
return fmt.Errorf("failed to connect to database: %w", err)
@@ -37,3 +41,7 @@ var SubmitCmd = &cobra.Command{
return nil
},
}
func init() {
SubmitCmd.Flags().Bool("dev", false, "Show DB connection details for development purposes")
}