Object
representing json_exists calls
Methods
Public Class
Public Instance
Attributes
expr | [R] |
Expression (context_item in PostgreSQL terms), usually |
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)
[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