Method: Sequel::Postgres::JSONBaseOp#to_recordset

Defined in:
lib/sequel/extensions/pg_json_ops.rb

#to_recordsetObject

Builds arbitrary set of records from json array of objects. You need to define the structure of the records using #as on the resulting object:

json_op.to_recordset.as(:x, [Sequel.lit('a integer'), Sequel.lit('b text')]) # json_to_recordset(json) AS x(a integer, b text)


484
485
486
# File 'lib/sequel/extensions/pg_json_ops.rb', line 484

def to_recordset
  function(:to_recordset)
end