attr_json icon indicating copy to clipboard operation
attr_json copied to clipboard

More flexible query and order methods, convenience wrappers around postgres operators

Open jrochkind opened this issue 2 years ago • 0 comments

It would be nice to have a methods to create ActiveRecord queries to let you:

  • order by an attr_json json attribute -- including a deeply nested one?
    • compare to https://github.com/madeintandem/jsonb_accessor#jsonb_order ; but we'd want to support nested attributes similar to how we do in jsonb_contains)
  • create queries for on attr_jsons, including nested ones, with arbitrary operators (like = or != or <=), with type-casting
    • compare again to similar features in jsonb_accessor... but again we need to support nested attributes, and automatic type-casting with known types

I had originally maybe wanted to get this in before attr_json 2, but I ran out of time... and realized when it is added it will not add any backwards incompat, so no need to work on it at a major version boundary.

jrochkind avatar Jan 19 '23 20:01 jrochkind