Class: ThinkingSphinx::ActiveRecord::DatabaseAdapters::MySQLAdapter

Inherits:
AbstractAdapter
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb

Instance Method Summary (collapse)

Methods inherited from AbstractAdapter

#initialize, #quote, #quoted_table_name

Constructor Details

This class inherits a constructor from ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter

Instance Method Details

- (Object) boolean_value(value)



4
5
6
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 4

def boolean_value(value)
  value ? 1 : 0
end

- (Object) cast_to_string(clause)



8
9
10
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 8

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

- (Object) cast_to_timestamp(clause)



12
13
14
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 12

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

- (Object) concatenate(clause, separator = ' ')



16
17
18
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 16

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

- (Object) convert_nulls(clause, default = '')



20
21
22
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 20

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

- (Object) group_concatenate(clause, separator = ' ')



24
25
26
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 24

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

- (Object) time_zone_query_pre



28
29
30
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 28

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

- (Object) utf8_query_pre



32
33
34
# File 'lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb', line 32

def utf8_query_pre
  ['SET NAMES utf8']
end