Class: Sequel::Postgres::JSONHash

Inherits:
JSONHashBase show all
Defined in:
lib/sequel/extensions/pg_json.rb,
lib/sequel/extensions/pg_json_ops.rb

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

#opObject

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



374
375
376
# File 'lib/sequel/extensions/pg_json_ops.rb', line 374

def op
  JSONOp.new(self)
end

#sql_literal_append(ds, sql) ⇒ Object

Cast as json



118
119
120
121
# File 'lib/sequel/extensions/pg_json.rb', line 118

def sql_literal_append(ds, sql)
  super
  sql << CAST_JSON
end