Sha256: 0372d39299cb3e6d66e37af8db1c7930c9cc993526cecdf570d6d6d699aa500b
Contents?: true
Size: 715 Bytes
Versions: 12
Compression:
Stored size: 715 Bytes
Contents
require "influxdb/rails/sql/normalizer" module InfluxDB module Rails module Sql class Query # :nodoc: attr_reader :query, :name TRACKED_SQL_COMMANDS = %w[SELECT INSERT UPDATE DELETE].freeze UNTRACKED_NAMES = %w[SCHEMA].freeze def initialize(payload) @query = payload[:sql].to_s.dup.upcase @name = payload[:name].to_s.dup end def operation query.split.first end def class_name name.split.first end def track? @track ||= query.start_with?(*TRACKED_SQL_COMMANDS) && !name.upcase.start_with?(*UNTRACKED_NAMES) end end end end end
Version data entries
12 entries across 12 versions & 3 rubygems