update the feature toggle usage in backend (#56787)

This commit is contained in:
ying-jeanne 2022-10-12 19:43:35 +08:00 committed by GitHub
parent 10c080dad1
commit 80ede174dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 1 deletions

View File

@ -74,4 +74,5 @@ export interface FeatureToggles {
increaseInMemDatabaseQueryCache?: boolean;
newPanelChromeUI?: boolean;
queryLibrary?: boolean;
mysqlAnsiQuotes?: boolean;
}

View File

@ -322,5 +322,10 @@ var (
State: FeatureStateAlpha,
RequiresDevMode: true,
},
{
Name: "mysqlAnsiQuotes",
Description: "Use double quote to escape keyword in Mysql query",
State: FeatureStateAlpha,
},
}
)

View File

@ -238,4 +238,8 @@ const (
// FlagQueryLibrary
// Reusable query library
FlagQueryLibrary = "queryLibrary"
// FlagMysqlAnsiQuotes
// Use double quote to escape keyword in Mysql query
FlagMysqlAnsiQuotes = "mysqlAnsiQuotes"
)

View File

@ -289,7 +289,7 @@ func (ss *SQLStore) buildConnectionString() (string, error) {
cnnstr += fmt.Sprintf("&tx_isolation=%s", val)
}
if ss.Cfg.IsFeatureToggleEnabled("mysqlAnsiQuotes") || ss.Cfg.IsFeatureToggleEnabled("newDBLibrary") {
if ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagMysqlAnsiQuotes) || ss.Cfg.IsFeatureToggleEnabled("newDBLibrary") {
cnnstr += "&sql_mode='ANSI_QUOTES'"
}