Class Sequel::Postgres::JSONHash
In: lib/sequel/extensions/pg_json.rb
lib/sequel/extensions/pg_json_ops.rb
Parent: DelegateClass(Hash)

Class representating PostgreSQL JSON column hash/object values.

Methods

Included Modules

Sequel::SQL::AliasMethods

External Aliases

__getobj__ -> to_hash
  Return the object being delegated to.

Public Instance methods

Wrap the JSONHash instance in an JSONOp, allowing you to easily use the PostgreSQL json functions and operators with literal jsons.

[Source]

     # File lib/sequel/extensions/pg_json_ops.rb, line 218
218:         def op
219:           JSONOp.new(self)
220:         end

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

[Source]

    # File lib/sequel/extensions/pg_json.rb, line 85
85:       def sql_literal_append(ds, sql)
86:         ds.literal_append(sql, Sequel.object_to_json(self))
87:         sql << CAST_JSON
88:       end

[Validate]