Sha256: 4f8fe8c612135d6572561212d2161ed6f3f4422c4f115690ddabc87e4dd488d6

Contents?: true

Size: 1.23 KB

Versions: 17

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

module ActiveRecord
  module OpenTracing
    module SqlSanitizer
      module Regexes
        MULTIPLE_SPACES    = /\s+/.freeze
        MULTIPLE_QUESTIONS = /\?(,\?)+/.freeze

        PSQL_VAR_INTERPOLATION = /\[\[.*\]\]\s*$/.freeze
        PSQL_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
        PSQL_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
        PSQL_PLACEHOLDER = /\$\d+/.freeze
        PSQL_IN_CLAUSE = /IN\s+\(\?[^\)]*\)/.freeze
        PSQL_AFTER_WHERE = /(?:WHERE\s+).*?(?:SELECT|$)/i.freeze

        MYSQL_VAR_INTERPOLATION = /\[\[.*\]\]\s*$/.freeze
        MYSQL_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
        MYSQL_REMOVE_SINGLE_QUOTE_STRINGS = /'(?:\\'|[^']|'')*'/.freeze
        MYSQL_REMOVE_DOUBLE_QUOTE_STRINGS = /"(?:\\"|[^"]|"")*"/.freeze
        MYSQL_IN_CLAUSE = /IN\s+\(\?[^\)]*\)/.freeze

        SQLITE_VAR_INTERPOLATION = /\[\[.*\]\]\s*$/.freeze
        SQLITE_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
        SQLITE_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze

        SQLSERVER_EXECUTESQL = /EXEC sp_executesql N'(.*?)'.*/.freeze
        SQLSERVER_REMOVE_INTEGERS = /(?<!LIMIT )\b(?<!@)\d+\b/.freeze
        SQLSERVER_IN_CLAUSE = /IN\s+\(\?[^\)]*\)/.freeze
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
activerecord-instrumentation-0.6.2 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.6.1 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.6.1.pre lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.6.0 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.6.0.jhemphill4 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.6.0.jhemphill3 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.6.0.jhemphill2 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.6.0.jhemphill1 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.5.2 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.5.2.pre lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.5.1 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.5.1.pre lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.4.0 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.4.0.jlauer4 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.4.0.jlauer3 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.4.0.jlauer2 lib/active_record/open_tracing/sql_sanitizer/regexes.rb
activerecord-instrumentation-0.4.0.jlauer1 lib/active_record/open_tracing/sql_sanitizer/regexes.rb