Class: Sequel::LiteralString
- Includes:
- Postgres::ArrayOpMethods, Postgres::HStoreOpMethods, Postgres::InetOpMethods, Postgres::JSONOpMethods, Postgres::PGRowOp::ExpressionMethods, Postgres::RangeOpMethods, SQL::AliasMethods, SQL::BooleanMethods, SQL::CastMethods, SQL::ComplexExpressionMethods, SQL::InequalityMethods, SQL::NumericMethods, SQL::OrderMethods, SQL::StringMethods
- Defined in:
- lib/sequel/sql.rb,
lib/sequel/sql.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/pg_array_ops.rb,
lib/sequel/extensions/pg_range_ops.rb,
lib/sequel/extensions/pg_hstore_ops.rb
Overview
LiteralString
is used to represent literal SQL expressions. A LiteralString
is copied verbatim into an SQL statement. Instances of LiteralString
can be created by calling Sequel.lit
.
Instance Method Summary collapse
-
#lit(*args) ⇒ Object
Return self if no args are given, otherwise return a SQL::PlaceholderLiteralString with the current string and the given args.
-
#to_sequel_blob ⇒ Object
Convert a literal string to a SQL::Blob.
Methods included from Postgres::HStoreOpMethods
Methods included from Postgres::RangeOpMethods
Methods included from Postgres::ArrayOpMethods
Methods included from Postgres::JSONOpMethods
Methods included from Postgres::InetOpMethods
Methods included from Postgres::PGRowOp::ExpressionMethods
Methods included from SQL::CastMethods
#cast, #cast_numeric, #cast_string
Methods included from SQL::AliasMethods
Methods included from SQL::StringMethods
Methods included from SQL::NumericMethods
Methods included from SQL::BooleanMethods
Methods included from SQL::ComplexExpressionMethods
#extract, #sql_boolean, #sql_number, #sql_string
Methods included from SQL::OrderMethods
Methods inherited from String
#blank?, #camelize, #classify, #constantize, #dasherize, #demodulize, #foreign_key, #humanize, inflections, #pluralize, #singularize, #tableize, #titleize, #to_date, #to_datetime, #to_sequel_time, #to_time, #underscore
Instance Method Details
#lit(*args) ⇒ Object
Return self if no args are given, otherwise return a SQL::PlaceholderLiteralString with the current string and the given args.
1927 1928 1929 |
# File 'lib/sequel/sql.rb', line 1927 def lit(*args) args.empty? ? self : SQL::PlaceholderLiteralString.new(self, args) end |