Class Symbol
In: lib/sequel/extensions/pg_hstore_ops.rb
lib/sequel/extensions/pg_row_ops.rb
lib/sequel/extensions/pg_array_ops.rb
lib/sequel/extensions/pg_range_ops.rb
lib/sequel/extensions/core_extensions.rb
Parent: Object

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

Methods

[]   identifier   sql_function  

Included Modules

Sequel::Postgres::HStoreOpMethods Sequel::Postgres::PGRowOp::ExpressionMethods Sequel::Postgres::ArrayOpMethods Sequel::Postgres::RangeOpMethods Sequel::SQL::AliasMethods Sequel::SQL::CastMethods Sequel::SQL::OrderMethods Sequel::SQL::BooleanMethods Sequel::SQL::NumericMethods Sequel::SQL::QualifyingMethods Sequel::SQL::StringMethods Sequel::SQL::SubscriptMethods Sequel::SQL::ComplexExpressionMethods Sequel::SQL::InequalityMethods

Public Instance methods

[](*args)

Alias for sql_function

Returns receiver wrapped in an Sequel::SQL::Identifier. Usually used to prevent splitting the symbol.

  :a__b # SQL: "a"."b"
  :a__b.identifier # SQL: "a__b"

[Source]

     # File lib/sequel/extensions/core_extensions.rb, line 218
218:   def identifier
219:     Sequel::SQL::Identifier.new(self)
220:   end

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/extensions/core_extensions.rb, line 230
230:   def sql_function(*args)
231:     Sequel::SQL::Function.new(self, *args)
232:   end

[Validate]