Class: Symbol
- Includes:
- Sequel::Postgres::ArrayOpMethods, Sequel::Postgres::HStoreOpMethods, Sequel::Postgres::InetOpMethods, Sequel::Postgres::JSONOpMethods, Sequel::Postgres::PGRowOp::ExpressionMethods, Sequel::Postgres::RangeOpMethods, Sequel::SQL::AliasMethods, Sequel::SQL::BooleanMethods, Sequel::SQL::CastMethods, Sequel::SQL::ComplexExpressionMethods, Sequel::SQL::IsDistinctFrom::Methods, Sequel::SQL::NumericMethods, Sequel::SQL::OrderMethods, Sequel::SQL::QualifyingMethods, Sequel::SQL::StringMethods, Sequel::SQL::SubscriptMethods, Sequel::SQLite::JSONOpMethods, Sequel::SymbolAref
- Defined in:
- lib/sequel/extensions/symbol_aref.rb,
lib/sequel/extensions/symbol_as.rb,
lib/sequel/extensions/pg_row_ops.rb,
lib/sequel/extensions/pg_inet_ops.rb,
lib/sequel/extensions/pg_json_ops.rb,
lib/sequel/extensions/symbol_aref.rb,
lib/sequel/extensions/pg_array_ops.rb,
lib/sequel/extensions/pg_range_ops.rb,
lib/sequel/extensions/pg_hstore_ops.rb,
lib/sequel/extensions/core_extensions.rb,
lib/sequel/extensions/sqlite_json_ops.rb,
lib/sequel/extensions/is_distinct_from.rb
Overview
Sequel extends Symbol
to add methods to implement the SQL DSL.
Instance Method Summary collapse
- #[](v) ⇒ Object
- #aref_before_sequel ⇒ Object
-
#identifier ⇒ Object
Returns receiver wrapped in an
Sequel::SQL::Identifier
. -
#sql_function(*args) ⇒ Object
Returns a
Sequel::SQL::Function
with this as the function name, and the given arguments.
Methods included from Sequel::SQL::IsDistinctFrom::Methods
Methods included from Sequel::SQLite::JSONOpMethods
#sqlite_json_op, #sqlite_jsonb_op
Methods included from Sequel::SQL::ComplexExpressionMethods
#extract, #sql_boolean, #sql_number, #sql_string
Methods included from Sequel::SQL::SubscriptMethods
Methods included from Sequel::SQL::StringMethods
#escaped_ilike, #escaped_like, #ilike, #like
Methods included from Sequel::SQL::QualifyingMethods
Methods included from Sequel::SQL::NumericMethods
Methods included from Sequel::SQL::BooleanMethods
Methods included from Sequel::SQL::OrderMethods
Methods included from Sequel::SQL::CastMethods
#cast, #cast_numeric, #cast_string
Methods included from Sequel::Postgres::HStoreOpMethods
Methods included from Sequel::Postgres::RangeOpMethods
Methods included from Sequel::Postgres::ArrayOpMethods
Methods included from Sequel::Postgres::JSONOpMethods
Methods included from Sequel::Postgres::InetOpMethods
Methods included from Sequel::Postgres::PGRowOp::ExpressionMethods
Methods included from Sequel::SQL::AliasMethods
Instance Method Details
#[](v) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/sequel/extensions/symbol_aref.rb', line 45 def [](v) case v when Symbol, Sequel::SQL::Identifier, Sequel::SQL::QualifiedIdentifier Sequel::SQL::QualifiedIdentifier.new(self, v) else aref_before_sequel(v) end end |
#aref_before_sequel ⇒ Object
42 |
# File 'lib/sequel/extensions/symbol_aref.rb', line 42 alias_method :aref_before_sequel, :[] |
#identifier ⇒ Object
Returns receiver wrapped in an Sequel::SQL::Identifier
.
:a.identifier # SQL: "a"
209 210 211 |
# File 'lib/sequel/extensions/core_extensions.rb', line 209 def identifier Sequel::SQL::Identifier.new(self) end |
#sql_function(*args) ⇒ Object
Returns a Sequel::SQL::Function
with this as the function name, and the given arguments.
:now.sql_function # SQL: now()
:sum.sql_function(:a) # SQL: sum(a)
:concat.sql_function(:a, :b) # SQL: concat(a, b)
219 220 221 |
# File 'lib/sequel/extensions/core_extensions.rb', line 219 def sql_function(*args) Sequel::SQL::Function.new(self, *args) end |