Sha256: 42582cd3fcb3ec605da61edb7c78e935a42b600d772f7b7d9264469a0eedda8a

Contents?: true

Size: 592 Bytes

Versions: 17

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::Connection::MRI < ThinkingSphinx::Connection::Client
  def base_error
    Mysql2::Error
  end

  private

  attr_reader :options

  def client
    @client ||= Mysql2::Client.new({
      :flags           => Mysql2::Client::MULTI_STATEMENTS,
      :connect_timeout => 5
    }.merge(options))
  rescue base_error => error
    raise ThinkingSphinx::SphinxError.new_from_mysql error
  end

  def results_for(statements)
    results  = [client.query(statements)]
    results << client.store_result while client.next_result
    results
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/connection/mri.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/connection/mri.rb