Method: Sequel::Access::DatasetMethods#constant_sql_append

Defined in:
lib/sequel/adapters/shared/access.rb

#constant_sql_append(sql, constant) ⇒ Object

Use Date(), Now(), and Time() for CURRENT_DATE, CURRENT_TIMESTAMP, and CURRENT_TIME

[View source]

157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/sequel/adapters/shared/access.rb', line 157

def constant_sql_append(sql, constant)
  case constant
  when :CURRENT_DATE
    sql << 'Date()'
  when :CURRENT_TIMESTAMP
    sql << 'Now()'
  when :CURRENT_TIME
    sql << 'Time()'
  else
    super
  end
end