Sha256: a1d6a8d8889e00a42a1ba487cbe17b21e3e1d46941274e89b19296636ebe0cca

Contents?: true

Size: 913 Bytes

Versions: 3

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  module Sql
    # @api private
    module Tokens
      OTHER = :OTHER
      COMMENT = :COMMENT
      IDENT = :IDENT
      NUMBER = :NUMBER
      STRING = :STRING

      PERIOD = :PERIOD
      COMMA = :COMMA
      LPAREN = :LPAREN
      RPAREN = :RPAREN

      AS = :AS
      CALL = :CALL
      DELETE = :DELETE
      FROM = :FROM
      INSERT = :INSERT
      INTO = :INTO
      OR = :OR
      REPLACE = :REPLACE
      SELECT = :SELECT
      SET = :SET
      TABLE = :TABLE
      TRUNCATE = :TRUNCATE
      UPDATE = :UPDATE

      KEYWORDS = {
        2 => [AS, OR],
        3 => [SET],
        4 => [CALL, FROM, INTO],
        5 => [TABLE],
        6 => [DELETE, INSERT, SELECT, UPDATE],
        7 => [REPLACE],
        8 => [TRUNCATE]
      }.freeze

      KEYWORD_MIN_LENGTH = KEYWORDS.keys.first
      KEYWORD_MAX_LENGTH = KEYWORDS.keys.last
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elastic-apm-3.6.0 lib/elastic_apm/sql/tokens.rb
elastic-apm-3.5.0 lib/elastic_apm/sql/tokens.rb
elastic-apm-3.4.0 lib/elastic_apm/sql/tokens.rb