Class: Sequel::LiteralString

Inherits:
String show all
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

Methods included from Postgres::HStoreOpMethods

#hstore

Methods included from Postgres::RangeOpMethods

#pg_range

Methods included from Postgres::ArrayOpMethods

#pg_array

Methods included from Postgres::JSONOpMethods

#pg_json, #pg_jsonb

Methods included from Postgres::InetOpMethods

#pg_inet

Methods included from Postgres::PGRowOp::ExpressionMethods

#pg_row

Methods included from SQL::CastMethods

#cast, #cast_numeric, #cast_string

Methods included from SQL::AliasMethods

#as

Methods included from SQL::StringMethods

#ilike, #like

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

#asc, #desc

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.



1886
1887
1888
# File 'lib/sequel/sql.rb', line 1886

def lit(*args)
  args.empty? ? self : SQL::PlaceholderLiteralString.new(self, args)
end

#to_sequel_blobObject

Convert a literal string to a SQL::Blob.



1891
1892
1893
# File 'lib/sequel/sql.rb', line 1891

def to_sequel_blob
  SQL::Blob.new(self)
end