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::IsDistinctFrom::Methods, SQL::NumericMethods, SQL::OrderMethods, SQL::StringMethods, SQLite::JSONOpMethods
- 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,
lib/sequel/extensions/sqlite_json_ops.rb,
lib/sequel/extensions/is_distinct_from.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
-
#inspect ⇒ Object
Show that the current string is a literal string in addition to the output.
-
#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 SQL::IsDistinctFrom::Methods
Methods included from SQLite::JSONOpMethods
#sqlite_json_op, #sqlite_jsonb_op
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
#escaped_ilike, #escaped_like, #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
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
#inspect ⇒ Object
Show that the current string is a literal string in addition to the output.
2030 2031 2032 |
# File 'lib/sequel/sql.rb', line 2030 def inspect "#<#{self.class} #{super}>" end |
#lit(*args) ⇒ Object
Return self if no args are given, otherwise return a SQL::PlaceholderLiteralString with the current string and the given args.
2036 2037 2038 |
# File 'lib/sequel/sql.rb', line 2036 def lit(*args) args.empty? ? self : SQL::PlaceholderLiteralString.new(self, args) end |