Module: Sequel::SQL::ColumnMethods

Defined in:
lib/sequel_core/core_sql.rb

Constant Summary collapse

AS =
'AS'.freeze
DESC =
'DESC'.freeze
ASC =
'ASC'.freeze

Instance Method Summary collapse

Instance Method Details

#allObject Also known as: ALL



137
# File 'lib/sequel_core/core_sql.rb', line 137

def all; Sequel::SQL::ColumnAll.new(self); end

#as(a) ⇒ Object Also known as: AS



128
# File 'lib/sequel_core/core_sql.rb', line 128

def as(a); ColumnExpr.new(self, AS, a); end

#ascObject Also known as: ASC



134
# File 'lib/sequel_core/core_sql.rb', line 134

def asc; ColumnExpr.new(self, ASC); end

#cast_as(t) ⇒ Object



140
141
142
143
144
145
# File 'lib/sequel_core/core_sql.rb', line 140

def cast_as(t)
  if t.is_a?(Symbol)
    t = t.to_s.lit
  end
  Sequel::SQL::Function.new(:cast, self.as(t))
end

#descObject Also known as: DESC



131
# File 'lib/sequel_core/core_sql.rb', line 131

def desc; ColumnExpr.new(self, DESC); end