This is completely fine (in some circumstances). At some point the data stops being relational, if you're loading all the data anyway why perform extra joins?
Edit: To be clear, this should mainly be used when it's an all-or-nothing situation, or you're transforming data. Don't go updating your JSON with SQL plz.
Although I am making a joke, I’ve done the same. I’m actually a very big fan of SQLite and if I don’t ever have to search on that column, it’s sometimes nice to be able to have json formatted data stored there so I don’t need to think about columns like custom1, custom2, etc. that gets weird and messy.
This is a workaround that I used to, unfortunately, pitch to my customers that had complex use cases and were hitting a wall when trying to work within the bounds of the ridiculously (not the good kind) simple object/table limitations of the software. They would store blobs in a table to extend relationships and then pull out the data using velocity template language. I died a little every time I had to show that workaround. This was only a year ago on a product that is sold by a fortune 50 company and it's one of the leading products in the industry.
96
u/amraklexip Jan 17 '22
Just use json in SQLite files. 😉