in reply to Re^2: key value in text format
in thread key value in text format
I think ideally you will model your (composite) key as separate columns. Then you can query either all key columns or just a subset of them.
If you want to keep things simple, keep the optional key-value pairs at the end as a single string. If you want to also query them, an approach a slight step better is to format and store them as JSON. Then you can query them in the database almost as if they were additional columns. The ideal way is to convert these optional things either into a fixed set of additional columns or add another table that consists of three columns, (row-key, keyname, value). But doing that makes the queries somewhat more ugly.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: key value in text format
by Don Coyote (Hermit) on Nov 06, 2019 at 10:32 UTC |