<commit_before>module ArJdbc
  module AS400
    include DB2
    include System

    # @private
    def self.extended(adapter); DB2.extended(adapter); end

    # @private
    def self.initialize!; DB2.initialize!; end

    # @see ActiveRecord::ConnectionAdapters::JdbcAdapter#jdbc_connection_class
    def self.jdbc_connection_class; DB2.jdbc_connection_class; end

    # @see ActiveRecord::ConnectionAdapters::Jdbc::ArelSupport
    def self.arel_visitor_type(config = nil); DB2.arel_visitor_type(config); end

    def self.column_selector
      [ /as400/i, lambda { |config, column| column.extend(Column) } ]
    end

    # @private
    Column = DB2::Column

    # Boolean emulation can be disabled using :
    #
    #   ArJdbc::AS400.emulate_booleans = false
    #
    def self.emulate_booleans; DB2.emulate_booleans; end
    def self.emulate_booleans=(emulate); DB2.emulate_booleans = emulate; end

    ADAPTER_NAME = 'AS400'.freeze
    DRIVER_NAME = 'com.ibm.as400.access.AS400JDBCDriver'.freeze
    NATIVE_DRIVER_NAME = 'com.ibm.db2.jdbc.app.DB2Driver'.freeze

    def adapter_name
      ADAPTER_NAME
    end

    # Set schema is it specified
    def configure_connection
      set_schema(config[:schema]) if config[:schema]
      change_current_library(config[:current_library]) if config[:current_library]
    end

    # Do not return *LIBL as schema
    def schema
      db2_schema
    end

    # Return only migrated tables
    def tables(name = nil)
      if system_naming? and !current_library
        raise StandardError.new('Unable to retrieve tables without current library')
      else
        @connection.tables(nil, name)
      end
    end

    # Prevent migration in QGPL
    def supports_migrations?
      !(system_naming? && !current_library?)
    end

    # @override
    def prefetch_primary_key?(table_name = nil)
      return true if table_name.nil?
      table_name = table_name.to_s
      columns(table_name).count { |column| column.primary } == 0
    end<commit_msg>fix tables method<commit_after>module ArJdbc
  module AS400
    include DB2
    include System

    # @private
    def self.extended(adapter); DB2.extended(adapter); end

    # @private
    def self.initialize!; DB2.initialize!; end

    # @see ActiveRecord::ConnectionAdapters::JdbcAdapter#jdbc_connection_class
    def self.jdbc_connection_class; DB2.jdbc_connection_class; end

    # @see ActiveRecord::ConnectionAdapters::Jdbc::ArelSupport
    def self.arel_visitor_type(config = nil); DB2.arel_visitor_type(config); end

    def self.column_selector
      [ /as400/i, lambda { |config, column| column.extend(Column) } ]
    end

    # @private
    Column = DB2::Column

    # Boolean emulation can be disabled using :
    #
    #   ArJdbc::AS400.emulate_booleans = false
    #
    def self.emulate_booleans; DB2.emulate_booleans; end
    def self.emulate_booleans=(emulate); DB2.emulate_booleans = emulate; end

    ADAPTER_NAME = 'AS400'.freeze
    DRIVER_NAME = 'com.ibm.as400.access.AS400JDBCDriver'.freeze
    NATIVE_DRIVER_NAME = 'com.ibm.db2.jdbc.app.DB2Driver'.freeze

    def adapter_name
      ADAPTER_NAME
    end

    # Set schema is it specified
    def configure_connection
      set_schema(config[:schema]) if config[:schema]
      change_current_library(config[:current_library]) if config[:current_library]
    end

    # Do not return *LIBL as schema
    def schema
      db2_schema
    end

    def tables(name = nil)
      # Do not perform search on all system
      if system_naming?
        name ||= current_library
        unless name
          raise StandardError.new('Unable to retrieve tables without current library')
        end
      end

      @connection.tables(nil, name)
    end

    # Prevent migration in QGPL
    def supports_migrations?
      !(system_naming? && !current_library?)
    end

    # @override
    def prefetch_primary_key?(table_name = nil)
      return true if table_name.nil?
      table_name = table_name.to_s
      columns(table_name).count { |column| column.primary } == 0
    end
{'fraction_non_alphanumeric': 0.0873015873015873, 'fraction_numerical': 0.01488095238095238, 'mean_word_length': 3.123721881390593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '92658', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1254, 'n_words': 288}