code: func WithMiddleware(c *router.Context, next router.Handler) {
  	database, err := getDatabaseConnection(c.Context)
  	if err != nil {
  		logging.Errorf(c.Context, "Failed to retrieve a database connection: %s", err.Error())
  		c.Writer.Header().Set("Content-Type", "text/plain")
  		c.Writer.WriteHeader(http.StatusInternalServerError)
  		return
  	}
  	c.Context = With(c.Context, database)
  	next(c)
  }
docs: // WithMiddleware is middleware which installs a database pointer into the given context.
  // It can be retrieved later in the middleware chain using Get.