class Sequel::Postgres::JSONExistsOp

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

Object representing json_exists calls

Methods

Public Class

  1. new

Public Instance

  1. expr
  2. on_error
  3. passing
  4. path
  5. sequel_ast_transform
  6. to_s_append

Attributes

expr [R]

Expression (context_item in PostgreSQL terms), usually JSONBaseOp instance

on_error [R]

How to handle errors when evaluating the JSON path expression

passing [R]

Variables to set in the JSON path expression

path [R]

JSON path expression to apply against the expression

Public Class methods

new(expr, path, opts=OPTS)

See JSONBaseOp#exists for documentation on the options.

[show source]
    # File lib/sequel/extensions/pg_json_ops.rb
906 def initialize(expr, path, opts=OPTS)
907   @expr = expr
908   @path = path
909   @passing = opts[:passing]
910   @on_error = opts[:on_error]
911   freeze
912 end

Public Instance methods

sequel_ast_transform(transformer)

Support transforming of function call expression

[show source]
    # File lib/sequel/extensions/pg_json_ops.rb
923 def sequel_ast_transform(transformer)
924   opts = {}
925   transform_opts(transformer, opts)
926   self.class.new(transformer.call(@expr), @path, opts)
927 end
to_s_append(ds, sql)

Append the SQL function call expression to the SQL

[show source]
    # File lib/sequel/extensions/pg_json_ops.rb
915 def to_s_append(ds, sql)
916   to_s_append_function_name(ds, sql)
917   to_s_append_args_passing(ds, sql)
918   to_s_append_on_error(ds, sql)
919   sql << ')'
920 end