class Sequel::Postgres::JSONTableOp::ColumnDSL

  1. lib/sequel/extensions/pg_json_ops.rb
Superclass: Object

Class used to evaluate json_table blocks and nested blocks

Methods

Public Class

  1. columns
  2. new

Public Instance

  1. Bignum
  2. column
  3. columns
  4. exists
  5. nested
  6. ordinality

Attributes

columns [R]

Return array of column information recorded for the instance

Public Class methods

columns(&block)
[show source]
     # File lib/sequel/extensions/pg_json_ops.rb
1163 def self.columns(&block)
1164   new(&block).columns.freeze
1165 end
new(&block)
[show source]
     # File lib/sequel/extensions/pg_json_ops.rb
1167 def initialize(&block)
1168   @columns = []
1169   instance_exec(&block)
1170 end

Public Instance methods

Bignum(name, opts=OPTS)

Include a bigint column

[show source]
     # File lib/sequel/extensions/pg_json_ops.rb
1193 def Bignum(name, opts=OPTS)
1194   @columns << [:column, name, :Bignum, opts].freeze
1195 end
column(name, type, opts=OPTS)

Include a regular column with the given type

[show source]
     # File lib/sequel/extensions/pg_json_ops.rb
1178 def column(name, type, opts=OPTS)
1179   @columns << [:column, name, type, opts].freeze
1180 end
exists(name, type, opts=OPTS)

Include an EXISTS column with the given type

[show source]
     # File lib/sequel/extensions/pg_json_ops.rb
1183 def exists(name, type, opts=OPTS)
1184   @columns << [:exists, name, type, opts].freeze
1185 end
nested(path, &block)

Include a nested set of columns at the given path.

[show source]
     # File lib/sequel/extensions/pg_json_ops.rb
1188 def nested(path, &block)
1189   @columns << [:nested, path, ColumnDSL.columns(&block)].freeze
1190 end
ordinality(name)

Include a FOR ORDINALITY column

[show source]
     # File lib/sequel/extensions/pg_json_ops.rb
1173 def ordinality(name)
1174   @columns << [:ordinality, name].freeze
1175 end