My database has a few tables which all have the sa...
# orm-help
r
My database has a few tables which all have the same schema, but their names vill vary (they are generated based on some runtime files). Any way to still use prisma for this?
r
Hey @Robin 👋 As per this, the table names would change every time based on some runtime generated right?
In that case, you can use introspection and fetch your tables from the given schema.
r
the user puts a few yaml's file in a folder. when the application (not my nextjs/prisma app) starts, it will create the tables (which always ahve the same structure)
I want to make a nextjs app with prisma now which should display some data from it
so I guess I have to make the introspect + generate + adjust the code so I access the right tables before each run of the nextjs app?
r
so I guess I have to make the introspect + generate + adjust the code so I access the right tables before each run of the nextjs app?
Yes exactly that would be the way to go. You don’t need to adjust the application code if you’re using
@@map
as described here. If your generated tables have the same structure as before with just the names being changed, you can just run
prisma gneerate
after mapping the table names correctly so your application code works.
r
awesome, thanks
👍 1
r
Let me know if it works 🙂