Scalar Lists in PlanetScale not supported
I would like to use scalar lists but as of now PlanetScale doesn't support this. Is there a way I can achieve this functionality or any workarounds anyone knows of?
3 Replies
I highly recommend using a supported connector like Postgres or MySQL since it supports more features you are looking for. There is no real work-around without caveats.
I used to JSON.stringify(data) on POST and parse with JSON.parse(data) on GET but like Janic already mentioned a list-supporting connector would be an easier and more stable as JSON.stringify has its own weird caveats such as no undefined etc.
You can always just create another table and one-to-many relate to form your array. That’s a very typical relational model
It’s okay if your new post_tag table only has one column, like value. You can even make it a many-to-many relation where value is unique, then let’s say in the future you need to find all of the posts with tag “new,” that becomes trivial to query