Home > Blockchain >  What is the best way to relate tables in HarperDB?
What is the best way to relate tables in HarperDB?

Time:09-02

If I had a Users table, and a Sessions table, how would you relate a row in the Sessions table to a row in the Users table? Would I use a foreign key? Or does HarperDB have a different recommended approach?

CodePudding user response:

HarperDB recommends using some sort of key to join data together. HarperDB does not enforce foreign key constraints, but you can use SQL to join the data together using a typical SQL join.

Check out the Quick Start example here that joins Dog and Breed tables together: https://api.harperdb.io/#6373ebde-9ff6-40f0-8819-8394fa4ef2fd

  • Related