Class: Sequel::Postgres::JSONHash

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

Overview

Class representating PostgreSQL JSON column hash/object values.

Instance Method Summary collapse

Methods included from SQL::AliasMethods

#as

Methods inherited from Hash

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

Instance Method Details

#sql_literal_append(ds, sql) ⇒ Object

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



85
86
87
88
# File 'lib/sequel/extensions/pg_json.rb', line 85

def sql_literal_append(ds, sql)
  ds.literal_append(sql, to_json)
  sql << CAST_JSON
end