// ShowSQL implement core.ILogger
513651
func (s *AdmpubLogger) ShowSQL(show ...bool) {
	if len(show) == 0 {
		s.showSQL = true
		return
	}
	s.showSQL = show[0]
}
732377
func (s *SqlQueryDatasetAction) SetSqlQuery(v string) *SqlQueryDatasetAction {
	s.SqlQuery = &v
	return s
}
78083
func (p *MySQLPrivilege) DBIsVisible(user, host, db string) bool {
	if record := p.matchUser(user, host); record != nil {
		if record.Privileges != 0 {
			return true
		}
	}

	// INFORMATION_SCHEMA is visible to all users.
	if strings.EqualFold(db, "INFORMATION_SCHEMA") {
		return true
	}

	if record := p.matchDB(user, host, db); record != nil {
		if record.Privileges > 0 {
			return true
		}
	}

	for _, record := range p.TablesPriv {
		if record.User == user &&
			patternMatch(host, record.patChars, record.patTypes) &&
			strings.EqualFold(record.DB, db) {
			if record.TablePriv != 0 || record.ColumnPriv != 0 {
				return true
			}
		}
	}

	for _, record := range p.ColumnsPriv {
		if record.User == user &&
			patternMatch(host, record.patChars, record.patTypes) &&
			strings.EqualFold(record.DB, db) {
			if record.ColumnPriv != 0 {
				return true
			}
		}
	}

	return false
}
427191
func (s *TopicRule) SetSql(v string) *TopicRule {
	s.Sql = &v
	return s
}
174263
func (n Notification) Show() (id uint32, err error) {
	conn, err := dbus.SessionBus()
	if err != nil {
		return
	}

	// We need to convert the interface type of the map to dbus.Variant as
	// people dont want to have to import the dbus package just to make use
	// of the notification hints.
	hints := map[string]dbus.Variant{}
	for k, v := range n.Hints {
		hints[k] = dbus.MakeVariant(v)
	}

	obj := conn.Object(DbusInterfacePath, DbusObjectPath)
	call := obj.Call(
		CallNotify,
		0,
		n.AppName,
		n.ReplacesID,
		n.AppIcon,
		n.Summary,
		n.Body,
		n.Actions,
		hints,
		n.Timeout)
	if err = call.Err; err != nil {
		return
	}

	err = call.Store(&id)
	return
}
1133507
func (c *StatusController) Show(ctx *app.ShowStatusContext) error {
	res := &app.Status{
		Commit:    Commit,
		BuildTime: BuildTime,
		StartTime: StartTime,
	}

	devMode := c.config.IsPostgresDeveloperModeEnabled()
	if devMode {
		res.DevMode = &devMode
	}

	dbErr := c.dbChecker.Ping()
	if dbErr != nil {
		log.Error(ctx, map[string]interface{}{
			"db_error": dbErr.Error(),
		}, "database configuration error")
		res.DatabaseStatus = fmt.Sprintf("Error: %s", dbErr.Error())
	} else {
		res.DatabaseStatus = "OK"
	}

	configErr := c.config.DefaultConfigurationError()
	if configErr != nil {
		log.Error(ctx, map[string]interface{}{
			"config_error": configErr.Error(),
		}, "configuration error")
		res.ConfigurationStatus = fmt.Sprintf("Error: %s", configErr.Error())
	} else {
		res.ConfigurationStatus = "OK"
	}

	if dbErr != nil || (configErr != nil && !devMode) {
		return ctx.ServiceUnavailable(res)
	}
	return ctx.OK(res)
}
958281
func (icon *Icon) Show(prefix string) {
	icon.fshow(os.Stdout, prefix)
}
667221
func Show(w http.ResponseWriter, req *http.Request) {
	ctxt := fs.NewContext(req)
	tag := req.URL.Path[len("/qr/show/"):]
	png := strings.HasSuffix(tag, ".png")
	if png {
		tag = tag[:len(tag)-len(".png")]
	}
	if !isTagName(tag) {
		fmt.Fprintf(w, "Sorry, QR code not found\n")
		return
	}
	if req.FormValue("flag") == "1" {
		flag(w, req, tag, ctxt)
		return
	}
	data, _, err := ctxt.Read("qrsave/" + tag)
	if err != nil {
		fmt.Fprintf(w, "Sorry, QR code not found.\n")
		return
	}

	var m Image
	if err := json.Unmarshal(data, &m); err != nil {
		panic(err)
	}
	m.Tag = tag

	switch req.FormValue("size") {
	case "big":
		m.Scale *= 2
	case "small":
		m.Scale /= 2
	}

	if png {
		if err := m.Encode(req); err != nil {
			panic(err)
			return
		}
		w.Header().Set("Cache-Control", "public, max-age=3600")
		w.Write(m.Code.PNG())
		return
	}

	w.Header().Set("Cache-Control", "public, max-age=300")
	runTemplate(ctxt, w, "qr/permalink.html", &m)
}
930227
func ShowTenant(ctx context.Context, config tenantConfig, options ...configuration.HTTPClientOption) (*tenant.TenantSingle, error) {
	c, err := createClient(ctx, config, options...)
	if err != nil {
		return nil, err
	}
	res, err := c.ShowTenant(goasupport.ForwardContextRequestID(ctx), tenant.ShowTenantPath())
	if err != nil {
		return nil, err
	}
	defer rest.CloseResponse(res)
	switch res.StatusCode {
	case http.StatusOK:
		tenant, err := c.DecodeTenantSingle(res)
		if err != nil {
			return nil, errors.NewInternalError(ctx, err)
		}
		return tenant, nil
	case http.StatusNotFound:
		jsonErr, err := c.DecodeJSONAPIErrors(res)
		if err == nil {
			if len(jsonErr.Errors) > 0 {
				log.Error(ctx, map[string]interface{}{
					"error_msg": jsonErr.Errors[0].Detail,
				}, "failed to retrieve tenant")
				return nil, errors.NewNotFoundError("tenants", *jsonErr.Errors[0].ID)
			}
		} else {
			log.Error(ctx, map[string]interface{}{"error_msg": err}, "failed to parse JSON-API error response")
		}

	}
	return nil, errors.NewInternalError(ctx, fmt.Errorf("Unknown response: '%v' (%d)", res.Status, res.StatusCode))
}
257306
func (c *CommentsController) Show(ctx *app.ShowCommentsContext) error {
	var cmt *comment.Comment
	err := application.Transactional(c.db, func(appl application.Application) error {
		var err error
		cmt, err = appl.Comments().Load(ctx, ctx.CommentID)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalRequest(*cmt, c.config.GetCacheControlComment, func() error {
		res := &app.CommentSingle{}
		// This code should change if others type of parents than WI are allowed
		includeParentWorkItem := CommentIncludeParentWorkItem(ctx, cmt)
		res.Data = ConvertComment(
			ctx.Request,
			*cmt,
			includeParentWorkItem)
		return ctx.OK(res)
	})
}
402589
func (n *Notification) Show() (err error) {
	if !n.isSupported {
		return
	}
	if err = n.isActionable(); err != nil {
		return
	}
	_, err = synchronousEvent(n.c, n, n.w, Event{Name: eventNameNotificationCmdShow, TargetID: n.id}, EventNameNotificationEventShown)
	return
}
497200
func (c *UsersController) Show(ctx *app.ShowUsersContext) error {
	tenantSA := token.IsSpecificServiceAccount(ctx, token.Tenant)
	isServiceAccount := tenantSA || token.IsSpecificServiceAccount(ctx, token.Notification)

	var identity *accountrepo.Identity
	err := transaction.Transactional(c.app, func(tr transaction.TransactionalResources) error {
		identityID, err := uuid.FromString(ctx.ID)
		if err != nil {
			return errors.NewBadParameterError("identity_id", ctx.ID)
		}
		identity, err = tr.Identities().LoadWithUser(ctx.Context, identityID)
		if err != nil {
			return err
		}

		if tenantSA && identity.User.Banned {
			// Don't return banned users for calls made by Tenant SA
			// TODO we should disable notifications for such users too but if we just return 401 for notification service request we may break it
			ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
			ctx.ResponseData.Header().Set("WWW-Authenticate", "DEPROVISIONED description=\"Account has been banned\"")
			return errors.NewUnauthorizedError("Account has been banned")
		}

		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalRequest(identity.User, c.config.GetCacheControlUser, func() error {
		return ctx.OK(ConvertToAppUser(ctx.RequestData, &identity.User, identity, isServiceAccount))
	})
}
475863
func (list *List) ShowOptions() int {
	result := 0

	for Index, element := range list.options {
		if Index == 0 {
			result += list.PrintHighlight(element) + list.Println()
			continue
		}

		result += list.PrintOption(element) + list.Println()
	}

	list.Index = 1
	list.Cursor.MoveUp(len(list.options))

	return result
}
1109146
func (c *CodebaseController) Show(ctx *app.ShowCodebaseContext) error {
	var cdb *codebase.Codebase
	err := application.Transactional(c.db, func(appl application.Application) error {
		var err error
		cdb, err = appl.Codebases().Load(ctx, ctx.CodebaseID)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.OK(&app.CodebaseSingle{
		Data: ConvertCodebase(ctx.Request, *cdb),
	})

}
1280687
func (do *Domain) ShowSlowQuery(showSlow *ast.ShowSlow) []*SlowQueryInfo {
	msg := &showSlowMessage{
		request: showSlow,
	}
	msg.Add(1)
	do.slowQuery.msgCh <- msg
	msg.Wait()
	return msg.result
}
403701
func (c *TrackerController) Show(ctx *app.ShowTrackerContext) error {
	var trkr *remoteworkitem.Tracker
	err := application.Transactional(c.db, func(appl application.Application) error {
		var err error
		trkr, err = appl.Trackers().Load(ctx.Context, ctx.ID)
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"err":        err,
				"tracker_id": ctx.ID,
			}, "unable to load the tracker by ID")
		}
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	result := &app.TrackerSingle{
		Data: ConvertTracker(ctx.Request, *trkr),
	}
	return ctx.OK(result)
}
24112
func (s *XormLogger) ShowSQL(show ...bool) {
	s.grafanaLog.Error("ShowSQL", "show", "show")
	if len(show) == 0 {
		s.showSQL = true
		return
	}
	s.showSQL = show[0]
}