-
We are working on building out a new service and were researching different ORM options. In our research, ElectroDB had the cleanest API and the best TypeScript support. With the model we have, using multiple tables would make more sense for us though. Is using multiple tables within ElectroDB as simple as setting the table prop on our Entity definitions? What impact does that have on key generation if so? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
- 8000
-
Hi @cwoolum 👋 You can target any table by supplying the table name in the entity config or in the execution options (e.g. |
Beta Was this translation helpful? Give feedback.
Hi @cwoolum 👋
You can target any table by supplying the table name in the entity config or in the execution options (e.g.
.go({table: 'my-table})
). If your model has a separate table per entity, there are no problems there; just know that collection queries assume entity members exist in the same table. Let me know if you run into any hiccups, I can offer suggestions and/or point out the options you have to do what you need.