Class: Sequel::Postgres::JSONArray

Inherits:
JSONArrayBase 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 Array

#case, #pg_array, #pg_json, #pg_jsonb, #pg_row, #sql_expr, #sql_negate, #sql_or, #sql_string_join, #sql_value_list, #~

Instance Method Details

#opObject

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


437
438
439
# File 'lib/sequel/extensions/pg_json_ops.rb', line 437

def op
  JSONOp.new(self)
end

#sql_literal_append(ds, sql) ⇒ Object

Cast as json


82
83
84
85
# File 'lib/sequel/extensions/pg_json.rb', line 82

def sql_literal_append(ds, sql)
  super
  sql << '::json'
end