<commit_before>module Chicago
  module Schema
    module TypeConverters
      # Generic type conversion strategy.
      #
      # This supplements Sequel's type conversion strategy rather than
      # replaces it, so :boolean will still return :boolean rather
      # than tinyint(1) in the case of mysql.
      class DbTypeConverter
        # Returns an appropriate type conversion stratgey for the given
        # database, +db+.
        #
        # If a database-specific strategy cannot be found, returns a
        # generic strategy.
        #
        # Currently onyl supports MySql-specific types
        def self.for_db(db)
          return MysqlTypeConverter.new if db.database_type == :mysql

          self.new
        end

        # Returns a db type given a column definition
        def db_type(column)
          case column.column_type
          when :integer then integer_type(column.min, column.max)
          when :string  then string_type(column.min, column.max)
          when :money   then :decimal
          else
            column.column_type
          end
        end

        def string_type(min, max)
          min && max && min == max ? :char : :varchar 
        end
            <commit_msg>Fix doc typo.<commit_after>module Chicago
  module Schema
    module TypeConverters
      # Generic type conversion strategy.
      #
      # This supplements Sequel's type conversion strategy rather than
      # replaces it, so :boolean will still return :boolean rather
      # than tinyint(1) in the case of mysql.
      class DbTypeConverter
        # Returns an appropriate type conversion stratgey for the given
        # database, +db+.
        #
        # If a database-specific strategy cannot be found, returns a
        # generic strategy.
        #
        # Currently only supports MySql-specific types
        def self.for_db(db)
          return MysqlTypeConverter.new if db.database_type == :mysql

          self.new
        end

        # Returns a db type given a column definition
        def db_type(column)
          case column.column_type
          when :integer then integer_type(column.min, column.max)
          when :string  then string_type(column.min, column.max)
          when :money   then :decimal
          else
            column.column_type
          end
        end

        def string_type(min, max)
          min && max && min == max ? :char : :varchar 
        end
            
{'fraction_non_alphanumeric': 0.05952380952380952, 'fraction_numerical': 0.0008210180623973727, 'mean_word_length': 1.8738207547169812, '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': '958854', 'n_tokens_mistral': 629, 'n_tokens_neox': 608, 'n_words': 228}