Module: Sequel::SQL::OrderMethods
- Included in:
- Dataset, LiteralString, ComplexExpression, EscapedLikeExpression, GenericExpression, StringAgg, Symbol
- Defined in:
- lib/sequel/sql.rb
Overview
Methods that create OrderedExpressions, used for sorting by columns or more complex expressions.
Instance Method Summary collapse
- 
  
    
      #asc(opts = OPTS)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Mark the receiving SQL column as sorting in an ascending fashion (generally a no-op). 
- 
  
    
      #desc(opts = OPTS)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Mark the receiving SQL column as sorting in a descending fashion. 
Instance Method Details
#asc(opts = OPTS) ⇒ Object
Mark the receiving SQL column as sorting in an ascending fashion (generally a no-op). Options:
- :nulls
- 
Set to :first to use NULLS FIRST (so NULL values are ordered before other values), or :last to use NULLS LAST (so NULL values are ordered after other values). 
| 902 903 904 | # File 'lib/sequel/sql.rb', line 902 def asc(opts=OPTS) OrderedExpression.new(self, false, opts) end | 
#desc(opts = OPTS) ⇒ Object
Mark the receiving SQL column as sorting in a descending fashion. Options:
- :nulls
- 
Set to :first to use NULLS FIRST (so NULL values are ordered before other values), or :last to use NULLS LAST (so NULL values are ordered after other values). 
| 912 913 914 | # File 'lib/sequel/sql.rb', line 912 def desc(opts=OPTS) OrderedExpression.new(self, true, opts) end |