Composite key strategies #195
thesmartwon
started this conversation in
General
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]); |
0 replies
|
Check out my code here to see how I created a nested structure - #180 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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.
All reactions