You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with JSON::Any columns is kind of a pain. I have no idea how this would work, or what things we would run in to, but I had this idea that would look like this:
There's a lot of things to consider like how does this look in forms, how does it affect queries, or operations, etc... There's also the fact that it's a pretty big performance hit to convert a JSON::Any object in to a serialized object from JSON. It would be neat if Crystal had that built-in, but until that happens, we'd have to probably just make that as the downside to an easier to work with object.
I just wanted to jot down some ideas here, and keep track of it. If anyone has some thoughts, let me know.
The text was updated successfully, but these errors were encountered:
I'm doing something like that manually for json columns, along with a type column which indicates which "schema" the json column would conform to. My use case for the json column is that I didn't want to do have a bunch of null-able columns or try to wrangle any sort of inheritance model, so I need multiple possible schemas.
Working with
JSON::Any
columns is kind of a pain. I have no idea how this would work, or what things we would run in to, but I had this idea that would look like this:My initial thought was under the hood, it would look something like:
There's a lot of things to consider like how does this look in forms, how does it affect queries, or operations, etc... There's also the fact that it's a pretty big performance hit to convert a JSON::Any object in to a serialized object from JSON. It would be neat if Crystal had that built-in, but until that happens, we'd have to probably just make that as the downside to an easier to work with object.
I just wanted to jot down some ideas here, and keep track of it. If anyone has some thoughts, let me know.
The text was updated successfully, but these errors were encountered: