Hi guys can we create dyamic tables with prisma? I...
# orm-help
j
Hi guys can we create dyamic tables with prisma? Im building a chat, I would like to have tables for each client ID, is this the best way, or whta should I do to scale 4 tables of a chat? Thx in advanced
r
@joao.santos 👋 It would be great if you could explain your use case for creating separate tables for each client ID. Dynamic tables can be created but require a bit more work from your end.
👍 1
j
Hi @Ryan, sorry for the delay havent been working... So in my application when we use MSSQL, we use dynamic tables for scalling... But now I'm using prisma and graphql and I want to dynamic create tables for different clients. Ex: I have 2 tables, Users and Posts... I want to create tables Users_1234 Posts_ 1234 and Users_4321 Posts_4321 the numbers being the client ID, then my query is based on whos logged in and pointing to their tables ID
Hoppefully I made myself clear... 🙂 thx for the help
m
joao add a column instead
add a clientId column to your table
j
Hi Mischa, thx for the advice, but the sql already exists, and I need to continue this system from the prisma side... Crete tables for the new clients and read the old ones according to the client... I know its no optimal, but its an old system that we dont have the time to refactor now 😞