class Sequel::Postgres::JSONTableOp::ColumnDSL
Class used to evaluate json_table blocks and nested blocks
Attributes
columns[R]
Return array of column information recorded for the instance
Public Class Methods
columns(&block)
click to toggle source
# File lib/sequel/extensions/pg_json_ops.rb 1179 def self.columns(&block) 1180 new(&block).columns.freeze 1181 end
new(&block)
click to toggle source
# File lib/sequel/extensions/pg_json_ops.rb 1183 def initialize(&block) 1184 @columns = [] 1185 instance_exec(&block) 1186 end
Public Instance Methods
Bignum(name, opts=OPTS)
click to toggle source
Include a bigint column
# File lib/sequel/extensions/pg_json_ops.rb 1209 def Bignum(name, opts=OPTS) 1210 @columns << [:column, name, :Bignum, opts].freeze 1211 end
column(name, type, opts=OPTS)
click to toggle source
Include a regular column with the given type
# File lib/sequel/extensions/pg_json_ops.rb 1194 def column(name, type, opts=OPTS) 1195 @columns << [:column, name, type, opts].freeze 1196 end
exists(name, type, opts=OPTS)
click to toggle source
Include an EXISTS column with the given type
# File lib/sequel/extensions/pg_json_ops.rb 1199 def exists(name, type, opts=OPTS) 1200 @columns << [:exists, name, type, opts].freeze 1201 end
nested(path, &block)
click to toggle source
Include a nested set of columns at the given path.
# File lib/sequel/extensions/pg_json_ops.rb 1204 def nested(path, &block) 1205 @columns << [:nested, path, ColumnDSL.columns(&block)].freeze 1206 end
ordinality(name)
click to toggle source
Include a FOR ORDINALITY column
# File lib/sequel/extensions/pg_json_ops.rb 1189 def ordinality(name) 1190 @columns << [:ordinality, name].freeze 1191 end