Sha256: 73d224dabd7e5eca234eec530230dc2f94b214921c24baa96eca8c391e7f2691

Contents?: true

Size: 919 Bytes

Versions: 8

Compression:

Stored size: 919 Bytes

Contents

class ThinkingSphinx::ActiveRecord::DatabaseAdapters::MySQLAdapter <
  ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter

  def boolean_value(value)
    value ? 1 : 0
  end

  def cast_to_bigint(clause)
    "CAST(#{clause} AS UNSIGNED INTEGER)"
  end

  def cast_to_string(clause)
    "CAST(#{clause} AS char)"
  end

  def cast_to_timestamp(clause)
    "UNIX_TIMESTAMP(#{clause})"
  end

  def concatenate(clause, separator = ' ')
    "CONCAT_WS('#{separator}', #{clause})"
  end

  def convert_nulls(clause, default = '')
    "IFNULL(#{clause}, #{default})"
  end

  def convert_blank(clause, default = '')
    "COALESCE(NULLIF(#{clause}, ''), #{default})"
  end

  def group_concatenate(clause, separator = ' ')
    "GROUP_CONCAT(DISTINCT #{clause} SEPARATOR '#{separator}')"
  end

  def time_zone_query_pre
    ["SET TIME_ZONE = '+0:00'"]
  end

  def utf8_query_pre
    ['SET NAMES utf8']
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb
thinking-sphinx-3.4.1 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb
thinking-sphinx-3.4.0 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb
thinking-sphinx-3.3.0 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb
thinking-sphinx-3.2.0 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb
thinking-sphinx-3.1.4 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb
thinking-sphinx-3.1.3 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb
thinking-sphinx-3.1.2 lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb