<commit_before>require_relative 'sql'

module Database
  module Strategies
    class Mysql < Sql
      module JrubyImplementation
        protected

        def load_dependencies
          require 'hanami/model/sql'
          require 'jdbc/mysql'
        end

        def export_env
          super
          ENV['HANAMI_DATABASE_URL'] = "jdbc:#{ENV['HANAMI_DATABASE_URL']}"
        end
      end

      module CiImplementation
        protected

        def export_env
          super
          ENV['HANAMI_DATABASE_USERNAME'] = 'travis'
          ENV['HANAMI_DATABASE_URL']      = "mysql://localhost/#{database_name}?useSSL=false"
        end

        private

        def run_command(command)
          result = system %(mysql -u root -e "#{command}")
          raise "Failed command:\n#{command}" unless result
        end
      end

      def self.eligible?(adapter)
        adapter.start_with?('mysql')
      end

      def initialize
        extend(CiImplementation)    if ci?<commit_msg>Use again 'travis' user for MySQL on CI for JRuby<commit_after>require_relative 'sql'

module Database
  module Strategies
    class Mysql < Sql
      module JrubyImplementation
        protected

        def load_dependencies
          require 'hanami/model/sql'
          require 'jdbc/mysql'
        end

        def export_env
          super
          ENV['HANAMI_DATABASE_URL'] = "jdbc:mysql2://#{ENV['HANAMI_DATABASE_USERNAME']}:#{ENV['HANAMI_DATABASE_PASSWORD']}@localhost/#{database_name}?useSSL=false"
        end
      end

      module CiImplementation
        protected

        def export_env
          super
          ENV['HANAMI_DATABASE_USERNAME'] = 'travis'
        end

        private

        def run_command(command)
          result = system %(mysql -u root -e "#{command}")
          raise "Failed command:\n#{command}" unless result
        end
      end

      def self.eligible?(adapter)
        adapter.start_with?('mysql')
      end

      def initialize
        extend(CiImplementation)    if ci?
{'fraction_non_alphanumeric': 0.0851063829787234, 'fraction_numerical': 0.0004948045522018803, 'mean_word_length': 2.036036036036036, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1776539', 'n_tokens_mistral': 612, 'n_tokens_neox': 575, 'n_words': 132}