class Sequel::Postgres::JSONQueryOp
Object
representing json_query calls
Constants
- ON_SQL
- WRAPPER
Attributes
wrapper[R]
How to handle wrapping of results
Public Class Methods
new(expr, path, opts=OPTS)
click to toggle source
See JSONBaseOp#query
for documentation of the options.
Calls superclass method
Sequel::Postgres::JSONValueOp::new
# File lib/sequel/extensions/pg_json_ops.rb 1093 def initialize(expr, path, opts=OPTS) 1094 @wrapper = opts[:wrapper] 1095 super 1096 end
Private Instance Methods
on_sql_value(value)
click to toggle source
# File lib/sequel/extensions/pg_json_ops.rb 1119 def on_sql_value(value) 1120 ON_SQL[value] 1121 end
to_s_append_args_passing(ds, sql)
click to toggle source
Also append the optional WRAPPER/OMIT QUOTES fragment
Calls superclass method
Sequel::Postgres::JSONValueOp#to_s_append_args_passing
# File lib/sequel/extensions/pg_json_ops.rb 1111 def to_s_append_args_passing(ds, sql) 1112 super 1113 1114 if @wrapper 1115 sql << WRAPPER.fetch(@wrapper) 1116 end 1117 end
to_s_append_function_name(ds, sql)
click to toggle source
# File lib/sequel/extensions/pg_json_ops.rb 1106 def to_s_append_function_name(ds, sql) 1107 sql << 'json_query(' 1108 end
transform_opts(transformer, opts)
click to toggle source
Also handle transforming the wrapper option
Calls superclass method
Sequel::Postgres::JSONValueOp#transform_opts
# File lib/sequel/extensions/pg_json_ops.rb 1101 def transform_opts(transformer, opts) 1102 super 1103 opts[:wrapper] = @wrapper 1104 end