require "mysql2"

module Support
  module QAHelpers
    module DataBase
      class Client
        attr_reader :client

        def initialize(params = {})
          db_params = {
            host: ENV["QA_AR_HOST"],
            username: ENV["QA_AR_USER"],
            password: ENV["QA_AR_PASS"],
            database: ENV["QA_AR_DATABASE"]
          }
          db_params.merge!(params)
          puts "Creating connection to #{db_params[:host]} DB"
          @client = Mysql2::Client.new(db_params)
        end
      end
    end
  end
end
