On Thu, Aug 17, 2023 at 3:11 AM [email protected] <[email protected]> wrote:
> I'm wanting to find records whose stored hash has a value (eventually > values). Searching for keys works, but values doesn't: > > *res = > htable.where(Sequel.hstore(:hstore_col).has_key?(keychoice)).select_map(:id)* > > While there is a method *has_value?(keychoice)*, it throws a > *NoMethodError*. > > > *res = > htable.where(Sequel.pg_store(:hstore_col).has_value?(valuechoice)).select_map(:id)* > > I am under the impression this is an iteration of keys or values, so it's > confusing why it's wrong. > I think you are confusing the hstore with hstore_op. Sequel.hstore(:hstore_col) returns an hstore_op. There is no has_value? on hstore_op. See https://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/pg_hstore_ops_rb.html . There doesn't appear to be a PostgreSQL function or oeprator that has_value? could use, which is why the pg_hstore_ops extension doesn't define such a method: https://www.postgresql.org/docs/current/hstore.html Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/CADGZSSc8V0_NqaDCP84QnL4xLL4PTD2%2BemFwwWqAFFaZOA44fQ%40mail.gmail.com.
