Closed vfr292 closed 5 years ago
I don't think this is fixable for the NestedMutableJson
class, because it would require a different base class, or include the comparators from Postgres' JSONB depending on the engine that's connected to and that sounds like a huge source of confusion and possible bugs.
However, what I think should work is taking the NestedMutable
class and applying it to SQLAlchemy's JSONB type, like this:
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy_json import NestedMutable
class JsonData(Base):
__tablename__ = 'json_datas'
id = Column(Integer, primary_key=True)
jsonb_nested_mutable = Column(NestedMutable.as_mutable(JSONB))
Hi, thank you! That worked
As I was going through different JSON implementation options I wrote a script to test their behaviors. I made a gist of it and it can be found here:
https://gist.github.com/vfr292/41530bfb56778ffc26fe53c605f40feb
Closing this as it's resolved.
Hi,
I'm doing something like:
Doing the filter query worked with the sqlalchemy MutableDict. However, it failes for the NestedMutableJson withthe error below:
Is it possible to search like I do with the sqlalchemy MutableDict? If so. would it be possible to provide an example?
Thank you!
~Victor