Composite key strategies #195
Replies: 2 comments
-
There is no support for composite keys in TinyBase as far as I know. Each row id of a TinyBase table is a single unique string field which does not get defined in the table schema. If you use the store's Also, if you do set const compositeRowId = `${key1}/${key2}`; // key from table 2
const parts = compositeRowId.split("/");
const related1 = store.getRow('table1', parts[0]);
const related2 = store.getRow('table1', parts[1]); |
Beta Was this translation helpful? Give feedback.
-
Check out my code here to see how I created a nested structure - #180 |
Beta Was this translation helpful? Give feedback.
-
What is the best pattern for composite keys? Is it:
OR
I don't have enough experience with the library yet to be able to evaluate the differences. I imagine the first interops better with existing SQL databases and queries.
Beta Was this translation helpful? Give feedback.
All reactions