Class: Gitlab::Database::QueryAnalyzers::Ci::PartitioningIdAnalyzer

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/database/query_analyzers/ci/partitioning_id_analyzer.rb

Overview

The purpose of this analyzer is to detect queries missing partition_id clause when selecting, inserting, updating or deleting data.

Constant Summary collapse

PartitionIdMissingError =
Class.new(QueryAnalyzerError)
ROUTING_TABLES =
%w[p_ci_builds_metadata].freeze

Constants inherited from Base

Base::QueryAnalyzerError

Class Method Summary collapse

Methods inherited from Base

analyzer_key, begin!, context, context_key, end!, requires_tracking?, suppress=, suppress_key, suppressed?, with_suppressed

Class Method Details

.analyze(parsed) ⇒ Object



20
21
22
# File 'lib/gitlab/database/query_analyzers/ci/partitioning_id_analyzer.rb', line 20

def analyze(parsed)
  analyze_partition_id_presence(parsed)
end

.enabled?Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/gitlab/database/query_analyzers/ci/partitioning_id_analyzer.rb', line 15

def enabled?
  ::Feature::FlipperFeature.table_exists? &&
    ::Feature.enabled?(:ci_partitioning_analyze_queries_partition_id_check, type: :ops)
end