Class: Sequel::Postgres::JSONHashBase

Inherits:
Hash show all
Includes:
SQL::AliasMethods, SQL::CastMethods
Defined in:
lib/sequel/extensions/pg_json.rb

Overview

Class representing PostgreSQL JSON/JSONB column hash/object values.

Direct Known Subclasses

JSONBHash, JSONHash

Instance Method Summary collapse

Methods included from SQL::CastMethods

#cast, #cast_numeric, #cast_string

Methods included from SQL::AliasMethods

#as

Methods inherited from Hash

#&, #case, #hstore, #pg_json, #pg_jsonb, #sql_expr, #sql_negate, #sql_or, #|, #~

Instance Method Details

#sql_literal_append(ds, sql) ⇒ Object

Convert the hash to a json string and append a literalized version of the string to the sql.



108
109
110
# File 'lib/sequel/extensions/pg_json.rb', line 108

def sql_literal_append(ds, sql)
  ds.literal_append(sql, Sequel.object_to_json(self))
end