Module: Searchgasm::ActiveRecord::ConnectionAdapters::MysqlAdapter

Defined in:
lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb

Instance Method Summary collapse

Instance Method Details

#absolute_sql(column_name) ⇒ Object

Number functions



80
81
82
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 80

def absolute_sql(column_name)
  "ABS(#{column_name})"
end

#acos_sql(column_name) ⇒ Object



84
85
86
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 84

def acos_sql(column_name)
  "ACOS(#{column_name})"
end

#asin_sql(column_name) ⇒ Object



88
89
90
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 88

def asin_sql(column_name)
  "ASIN(#{column_name})"
end

#atan_sql(column_name) ⇒ Object



92
93
94
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 92

def atan_sql(column_name)
  "ATAN(#{column_name})"
end

#ceil_sql(column_name) ⇒ Object



96
97
98
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 96

def ceil_sql(column_name)
  "CEIL(#{column_name})"
end

#char_length_sql(column_name) ⇒ Object

String functions



51
52
53
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 51

def char_length_sql(column_name)
  "CHAR_LENGTH(#{column_name})"
end

#cos_sql(column_name) ⇒ Object



100
101
102
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 100

def cos_sql(column_name)
  "COS(#{column_name})"
end

#cot_sql(column_name) ⇒ Object



104
105
106
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 104

def cot_sql(column_name)
  "COT(#{column_name})"
end

#day_of_month_sql(column_name) ⇒ Object



30
31
32
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 30

def day_of_month_sql(column_name)
  "DAYOFMONTH(#{column_name})"
end

#day_of_week_sql(column_name) ⇒ Object



26
27
28
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 26

def day_of_week_sql(column_name)
  "DAYOFWEEK(#{column_name})"
end

#day_of_year_sql(column_name) ⇒ Object



34
35
36
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 34

def day_of_year_sql(column_name)
  "DAYOFYEAR(#{column_name})"
end

#degrees_sql(column_name) ⇒ Object



108
109
110
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 108

def degrees_sql(column_name)
  "DEGREES(#{column_name})"
end

#exp_sql(column_name) ⇒ Object



112
113
114
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 112

def exp_sql(column_name)
  "EXP(#{column_name})"
end

#floor_sql(column_name) ⇒ Object



116
117
118
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 116

def floor_sql(column_name)
  "FLOOR(#{column_name})"
end

#hex_sql(column_name) ⇒ Object



120
121
122
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 120

def hex_sql(column_name)
  "HEX(#{column_name})"
end

#hour_sql(column_name) ⇒ Object



22
23
24
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 22

def hour_sql(column_name)
  "HOUR(#{column_name})"
end

#ln_sql(column_name) ⇒ Object



124
125
126
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 124

def ln_sql(column_name)
  "LN(#{column_name})"
end

#log10_sql(column_name) ⇒ Object



136
137
138
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 136

def log10_sql(column_name)
  "LOG10(#{column_name})"
end

#log2_sql(column_name) ⇒ Object



132
133
134
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 132

def log2_sql(column_name)
  "LOG2(#{column_name})"
end

#log_sql(column_name) ⇒ Object



128
129
130
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 128

def log_sql(column_name)
  "LOG(#{column_name})"
end

#lower_sql(column_name) ⇒ Object



55
56
57
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 55

def lower_sql(column_name)
  "LOWER(#{column_name})"
end

#ltrim_sql(column_name) ⇒ Object



59
60
61
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 59

def ltrim_sql(column_name)
  "LTRIM(#{column_name})"
end

#md5_sql(column_name) ⇒ Object



63
64
65
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 63

def md5_sql(column_name)
  "MD5(#{column_name})"
end

#microseconds_sql(column_name) ⇒ Object

Date / time functions



6
7
8
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 6

def microseconds_sql(column_name)
  "MICROSECOND(#{column_name})"
end

#milliseconds_sql(column_name) ⇒ Object



10
11
12
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 10

def milliseconds_sql(column_name)
  "(MICROSECOND(#{column_name}) / 1000)"
end

#minute_sql(column_name) ⇒ Object



18
19
20
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 18

def minute_sql(column_name)
  "MINUTE(#{column_name})"
end

#month_sql(column_name) ⇒ Object



42
43
44
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 42

def month_sql(column_name)
  "MONTH(#{column_name})"
end

#octal_sql(column_name) ⇒ Object



140
141
142
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 140

def octal_sql(column_name)
  "OCT(#{column_name})"
end

#radians_sql(column_name) ⇒ Object



144
145
146
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 144

def radians_sql(column_name)
  "RADIANS(#{column_name})"
end

#round_sql(column_name) ⇒ Object



148
149
150
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 148

def round_sql(column_name)
  "ROUND(#{column_name})"
end

#rtrim_sql(column_name) ⇒ Object



67
68
69
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 67

def rtrim_sql(column_name)
  "RTRIM(#{column_name})"
end

#second_sql(column_name) ⇒ Object



14
15
16
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 14

def second_sql(column_name)
  "SECOND(#{column_name})"
end

#sign_sql(column_name) ⇒ Object



152
153
154
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 152

def sign_sql(column_name)
  "SIGN(#{column_name})"
end

#sin_sql(column_name) ⇒ Object



156
157
158
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 156

def sin_sql(column_name)
  "SIN(#{column_name})"
end

#square_root_sql(column_name) ⇒ Object



160
161
162
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 160

def square_root_sql(column_name)
  "SQRT(#{column_name})"
end

#tan_sql(column_name) ⇒ Object



164
165
166
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 164

def tan_sql(column_name)
  "TAN(#{column_name})"
end

#trim_sql(column_name) ⇒ Object



71
72
73
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 71

def trim_sql(column_name)
  "TRIM(#{column_name})"
end

#upper_sql(column_name) ⇒ Object



75
76
77
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 75

def upper_sql(column_name)
  "UPPER(#{column_name})"
end

#week_sql(column_name) ⇒ Object



38
39
40
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 38

def week_sql(column_name)
  "WEEK(#{column_name}, 2)"
end

#year_sql(column_name) ⇒ Object



46
47
48
# File 'lib/searchgasm/active_record/connection_adapters/mysql_adapter.rb', line 46

def year_sql(column_name)
  "YEAR(#{column_name})"
end