We have an increasing number of features that can have different values; not all of them are available on all devices.
In order to provide more precise information about the possible values for a particular feature, we therefore need to be able to know and store these values.
Source thread:
Here we will discuss possible solutions to carry out this project.
I remind you we’re using a relational model, so there are several options for that:
The relational way would be to create a table device_feature_managed_value that would be in a 1-N relationship with the device_feature table. It’s stricter, but also more cumbersome to manage on insert/delete.
Or the way you mention, but then you have to serialize/deserialize the array on write/read and store that as a SQLite string. That also opens the door to all sorts of nonsense since you have to handle data consistency in the application layer, and implement any eventual data migrations in JS rather than in SQL.
To be honest, both approaches have their advantages and disadvantages!