blob: 2e73fbb79a2392dc0f64b70529d93dea8932fba0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# frozen_string_literal: true
# Currently we register validator only for `dev` or `test` environment
Gitlab::Database::QueryAnalyzer.instance.hook!
Gitlab::Database::QueryAnalyzer.instance.all_analyzers.append(::Gitlab::Database::QueryAnalyzers::GitlabSchemasMetrics)
Gitlab::Database::QueryAnalyzer.instance.all_analyzers.append(
::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification
)
if Gitlab.dev_or_test_env?
query_analyzer = ::Gitlab::Database::QueryAnalyzers::GitlabSchemasValidateConnection
Gitlab::Database::QueryAnalyzer.instance.all_analyzers.append(query_analyzer)
end
Gitlab::Application.configure do |config|
config.middleware.use(Gitlab::Middleware::QueryAnalyzer)
end
|