Class Symbol
In: lib/sequel/core_sql.rb
Parent: Object

Sequel extends the Symbol class to add methods to implement the SQL DSL.

Methods

*   []   sql_function   sql_subscript  

Included Modules

Sequel::SQL::QualifyingMethods Sequel::SQL::IdentifierMethods Sequel::SQL::AliasMethods Sequel::SQL::CastMethods Sequel::SQL::OrderMethods Sequel::SQL::BooleanMethods Sequel::SQL::NumericMethods Sequel::SQL::StringMethods Sequel::SQL::ComplexExpressionMethods Sequel::SQL::InequalityMethods

Public Instance methods

If no argument is given, returns a Sequel::SQL::ColumnAll object specifying all columns for this table. If an argument is given, returns a Sequel::SQL::NumericExpression using the * (multiplication) operator with this and the given argument.

  :table.* # SQL: table.*
  :column * 2 # SQL: column * 2

[Source]

     # File lib/sequel/core_sql.rb, line 223
223:   def *(ce=(arg=false;nil))
224:     return super(ce) unless arg == false
225:     Sequel::SQL::ColumnAll.new(self);
226:   end
[](*args)

Alias for sql_function

Returns a Sequel::SQL::Function with this as the function name, and the given arguments. This is aliased as Symbol#[] if the RUBY_VERSION is less than 1.9.0. Ruby 1.9 defines Symbol#[], and Sequel doesn‘t override methods defined by ruby itself.

  :now.sql_function # SQL: now()
  :sum.sql_function(:a) # SQL: sum(a)
  :concat.sql_function(:a, :b) # SQL: concat(a, b)

[Source]

     # File lib/sequel/core_sql.rb, line 236
236:   def sql_function(*args)
237:     Sequel::SQL::Function.new(self, *args)
238:   end

Return an SQL array subscript with the given arguments.

  :array.sql_subscript(1) # SQL: array[1]
  :array.sql_subscript(1, 2) # SQL: array[1, 2]

[Source]

     # File lib/sequel/core_sql.rb, line 245
245:   def sql_subscript(*sub)
246:     Sequel::SQL::Subscript.new(self, sub.flatten)
247:   end

[Validate]