Module: Searchgasm::ActiveRecord::ConnectionAdapters::SQLiteAdapter
- Defined in:
- lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb
Instance Method Summary collapse
- #day_of_month_sql(column_name) ⇒ Object
- #day_of_week_sql(column_name) ⇒ Object
- #day_of_year_sql(column_name) ⇒ Object
- #hour_sql(column_name) ⇒ Object
-
#lower_sql(column_name) ⇒ Object
String functions.
- #ltrim_sql(column_name) ⇒ Object
-
#microseconds_sql(column_name) ⇒ Object
Date functions.
- #milliseconds_sql(column_name) ⇒ Object
- #minute_sql(column_name) ⇒ Object
- #month_sql(column_name) ⇒ Object
- #rtrim_sql(column_name) ⇒ Object
- #second_sql(column_name) ⇒ Object
- #trim_sql(column_name) ⇒ Object
- #upper_sql(column_name) ⇒ Object
- #week_sql(column_name) ⇒ Object
- #year_sql(column_name) ⇒ Object
Instance Method Details
#day_of_month_sql(column_name) ⇒ Object
30 31 32 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 30 def day_of_month_sql(column_name) "strftime('%d', #{column_name})" end |
#day_of_week_sql(column_name) ⇒ Object
26 27 28 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 26 def day_of_week_sql(column_name) "strftime('%w', #{column_name})" end |
#day_of_year_sql(column_name) ⇒ Object
34 35 36 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 34 def day_of_year_sql(column_name) "strftime('%j', #{column_name})" end |
#hour_sql(column_name) ⇒ Object
22 23 24 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 22 def hour_sql(column_name) "strftime('%H', #{column_name})" end |
#lower_sql(column_name) ⇒ Object
String functions
51 52 53 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 51 def lower_sql(column_name) "lower(#{column_name})" end |
#ltrim_sql(column_name) ⇒ Object
55 56 57 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 55 def ltrim_sql(column_name) "ltrim(#{column_name})" end |
#microseconds_sql(column_name) ⇒ Object
Date functions
6 7 8 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 6 def microseconds_sql(column_name) "((strftime('%f', #{column_name}) % 1) * 1000000)" end |
#milliseconds_sql(column_name) ⇒ Object
10 11 12 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 10 def milliseconds_sql(column_name) "((strftime('%f', #{column_name}) % 1) * 1000)" end |
#minute_sql(column_name) ⇒ Object
18 19 20 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 18 def minute_sql(column_name) "strftime('%M', #{column_name})" end |
#month_sql(column_name) ⇒ Object
42 43 44 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 42 def month_sql(column_name) "strftime('%m', #{column_name})" end |
#rtrim_sql(column_name) ⇒ Object
59 60 61 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 59 def rtrim_sql(column_name) "rtrim(#{column_name})" end |
#second_sql(column_name) ⇒ Object
14 15 16 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 14 def second_sql(column_name) "strftime('%S', #{column_name})" end |
#trim_sql(column_name) ⇒ Object
63 64 65 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 63 def trim_sql(column_name) "trim(#{column_name})" end |
#upper_sql(column_name) ⇒ Object
67 68 69 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 67 def upper_sql(column_name) "upper(#{column_name})" end |
#week_sql(column_name) ⇒ Object
38 39 40 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 38 def week_sql(column_name) "strftime('%W', #{column_name})" end |
#year_sql(column_name) ⇒ Object
46 47 48 |
# File 'lib/searchgasm/active_record/connection_adapters/sqlite_adapter.rb', line 46 def year_sql(column_name) "strftime('%Y', #{column_name})" end |