Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Logging, auditing, warnings, and PingContext failure handling for switch DB #77

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ninabauer
Copy link
Contributor

  • adds log output when switching db name
  • adds dbname in audit data
  • after OverrideDBName, try a DB.PingContext, if it fails, fall back to its last value.
  • when current db name is different with env DB_NAME, returns a warning saying current db is not the default one in the response json

Result [][]string `json:"result"`
Error string `json:"error"`
Result [][]string `json:"result"`
Warnings []string `json:"warnings,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason to set Warnings as an array? It is a bit weird to have Error as string but Warning as Array.

response := models.DBNameResponse{DBName: dbName}

if dbName != defaultDBName {
warning := "Current database differs from the default"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add dbName and defaultDBName info to the warn msg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants