Module: Searchgasm::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

Defined in:
lib/searchgasm/active_record/connection_adapters/postgresql_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/postgresql_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/postgresql_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/postgresql_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/postgresql_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/postgresql_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/postgresql_adapter.rb', line 51

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

#cos_sql(column_name) ⇒ Object



100
101
102
# File 'lib/searchgasm/active_record/connection_adapters/postgresql_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/postgresql_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/postgresql_adapter.rb', line 30

def day_of_month_sql(column_name)
  "date_part('day', #{column_name})"
end

#day_of_week_sql(column_name) ⇒ Object



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

def day_of_week_sql(column_name)
  "(date_part('dow', #{column_name}) + 1)"
end

#day_of_year_sql(column_name) ⇒ Object



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

def day_of_year_sql(column_name)
  "date_part('doy', #{column_name})"
end

#degrees_sql(column_name) ⇒ Object



108
109
110
# File 'lib/searchgasm/active_record/connection_adapters/postgresql_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/postgresql_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/postgresql_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/postgresql_adapter.rb', line 120

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

#hour_sql(column_name) ⇒ Object



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

def hour_sql(column_name)
  "date_part('hour', #{column_name})"
end

#ln_sql(column_name) ⇒ Object



124
125
126
# File 'lib/searchgasm/active_record/connection_adapters/postgresql_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/postgresql_adapter.rb', line 136

def log10_sql(column_name)
  "log(10.0, #{column_name})"
end

#log2_sql(column_name) ⇒ Object



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

def log2_sql(column_name)
  "log(2.0, #{column_name})"
end

#log_sql(column_name) ⇒ Object



128
129
130
# File 'lib/searchgasm/active_record/connection_adapters/postgresql_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/postgresql_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/postgresql_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/postgresql_adapter.rb', line 63

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

#microseconds_sql(column_name) ⇒ Object

Datetime functions



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

def microseconds_sql(column_name)
  "date_part('microseconds', #{column_name})"
end

#milliseconds_sql(column_name) ⇒ Object



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

def milliseconds_sql(column_name)
  "date_part('milliseconds', #{column_name})"
end

#minute_sql(column_name) ⇒ Object



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

def minute_sql(column_name)
  "date_part('minute', #{column_name})"
end

#month_sql(column_name) ⇒ Object



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

def month_sql(column_name)
  "date_part('month', #{column_name})"
end

#radians_sql(column_name) ⇒ Object



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

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

#round_sql(column_name) ⇒ Object



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

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

#rtrim_sql(column_name) ⇒ Object



67
68
69
# File 'lib/searchgasm/active_record/connection_adapters/postgresql_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/postgresql_adapter.rb', line 14

def second_sql(column_name)
  "date_part('second', #{column_name})"
end

#sign_sql(column_name) ⇒ Object



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

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

#sin_sql(column_name) ⇒ Object



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

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

#square_root_sql(column_name) ⇒ Object



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

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

#tan_sql(column_name) ⇒ Object



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

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

#trim_sql(column_name) ⇒ Object



71
72
73
# File 'lib/searchgasm/active_record/connection_adapters/postgresql_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/postgresql_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/postgresql_adapter.rb', line 38

def week_sql(column_name)
  "date_part('week', #{column_name})"
end

#year_sql(column_name) ⇒ Object



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

def year_sql(column_name)
  "date_part('year', #{column_name})"
end