diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index e242030c117..27ffaed281c 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -60,7 +60,6 @@ Some features are enabled by default. You can disable these feature by setting t | `panelTitleSearch` | Search for dashboards using panel title | | `migrationLocking` | Lock database during migrations | | `correlations` | Correlations page | -| `newDBLibrary` | Use jmoiron/sqlx rather than xorm for a few backend services | | `autoMigrateOldPanels` | Migrate old angular panels to supported versions (graph, table-old, worldmap, etc) | | `disableAngular` | Dynamic flag to disable angular at runtime. The preferred method is to set `angular_support_enabled` to `false` in the [security] settings, which allows you to change the state at runtime. | | `grpcServer` | Run the GRPC server | diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index f42edfe3955..5116688fe88 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -32,7 +32,6 @@ export interface FeatureToggles { exploreContentOutline?: boolean; datasourceQueryMultiStatus?: boolean; traceToMetrics?: boolean; - newDBLibrary?: boolean; autoMigrateOldPanels?: boolean; disableAngular?: boolean; canvasPanelNesting?: boolean; diff --git a/pkg/infra/db/db.go b/pkg/infra/db/db.go index 137a0dd9e14..6cf32ae6606 100644 --- a/pkg/infra/db/db.go +++ b/pkg/infra/db/db.go @@ -34,6 +34,9 @@ type DB interface { GetEngine() *xorm.Engine // GetSqlxSession is an experimental extension to use sqlx instead of xorm to // communicate with the database. + // NOTE: when using this session with mysql, the connection will *not* have: + // the expected parameters: "&sql_mode='ANSI_QUOTES" and "&parseTime=true" + // The sqlx session is useful, but be careful not to expect automagic date parsing GetSqlxSession() *session.SessionDB // InTransaction creates a new SQL transaction that is placed on the context. // Use together with [DB.WithDbSession] to run database operations. diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 1deeb83e596..c2b0a13dcdf 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -107,12 +107,6 @@ var ( FrontendOnly: true, Owner: grafanaObservabilityTracesAndProfilingSquad, }, - { - Name: "newDBLibrary", - Description: "Use jmoiron/sqlx rather than xorm for a few backend services", - Stage: FeatureStagePublicPreview, - Owner: grafanaBackendPlatformSquad, - }, { Name: "autoMigrateOldPanels", Description: "Migrate old angular panels to supported versions (graph, table-old, worldmap, etc)", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index 39dca9b64a4..174237f5d92 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -13,7 +13,6 @@ correlations,preview,@grafana/explore-squad,false,false,false,false exploreContentOutline,GA,@grafana/explore-squad,false,false,false,true datasourceQueryMultiStatus,experimental,@grafana/plugins-platform-backend,false,false,false,false traceToMetrics,experimental,@grafana/observability-traces-and-profiling,false,false,false,true -newDBLibrary,preview,@grafana/backend-platform,false,false,false,false autoMigrateOldPanels,preview,@grafana/dataviz-squad,false,false,false,true disableAngular,preview,@grafana/dataviz-squad,false,false,false,true canvasPanelNesting,experimental,@grafana/dataviz-squad,false,false,false,true diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 0260ed854d5..95b5a503359 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -63,10 +63,6 @@ const ( // Enable trace to metrics links FlagTraceToMetrics = "traceToMetrics" - // FlagNewDBLibrary - // Use jmoiron/sqlx rather than xorm for a few backend services - FlagNewDBLibrary = "newDBLibrary" - // FlagAutoMigrateOldPanels // Migrate old angular panels to supported versions (graph, table-old, worldmap, etc) FlagAutoMigrateOldPanels = "autoMigrateOldPanels" diff --git a/pkg/services/sqlstore/sqlstore.go b/pkg/services/sqlstore/sqlstore.go index 63e215de8fa..342e72f4fdb 100644 --- a/pkg/services/sqlstore/sqlstore.go +++ b/pkg/services/sqlstore/sqlstore.go @@ -308,15 +308,10 @@ func (ss *SQLStore) buildConnectionString() (string, error) { } // nolint:staticcheck - if ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagMysqlAnsiQuotes) || ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagNewDBLibrary) { + if ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagMysqlAnsiQuotes) { cnnstr += "&sql_mode='ANSI_QUOTES'" } - // nolint:staticcheck - if ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagNewDBLibrary) { - cnnstr += "&parseTime=true" - } - cnnstr += ss.buildExtraConnectionString('&') case migrator.Postgres: addr, err := util.SplitHostPortDefault(ss.dbCfg.Host, "127.0.0.1", "5432") diff --git a/pkg/services/sqlstore/sqlstore_test.go b/pkg/services/sqlstore/sqlstore_test.go index 282503b682f..8b696120435 100644 --- a/pkg/services/sqlstore/sqlstore_test.go +++ b/pkg/services/sqlstore/sqlstore_test.go @@ -104,13 +104,6 @@ var sqlStoreTestCases = []sqlStoreTest{ features: featuremgmt.WithFeatures(featuremgmt.FlagMysqlAnsiQuotes), expConnStr: ":@tcp([::1])/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&sql_mode='ANSI_QUOTES'", }, - { - name: "New DB library", - dbType: "mysql", - dbHost: "[::1]", - features: featuremgmt.WithFeatures(featuremgmt.FlagNewDBLibrary), - expConnStr: ":@tcp([::1])/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&sql_mode='ANSI_QUOTES'&parseTime=true", - }, } func TestIntegrationSQLConnectionString(t *testing.T) {