can one integrate supertokens with an existing dat...
# support-questions-legacy
z
can one integrate supertokens with an existing database? For instance, Im running a prisma client connected to a postgresql db, which has a schema for users. I would love if I could connect supertokens and my db somehow. For more context, Im using prisma to expose a graphql api, which I would like the auth to be used on
r
hey @zebleck you can do this - just provide your current db's connection uri to the core, and the core will create and manage supertokens related tables in the same db. That being said, these tables will be unrelated to the prisma schema for your app, and you should keep it that way.
z
Thanks for the quick response! That means however that users will be stored seperately from the one in my prisma schema and I will have to implement some kind of synchronization scheme I suppose
r
yes.
i mean you could add our db schema to your prisma schema as well.
and when you start the core, it will just use those already created tables.
z
Thank you very much, I will try it out!
49 Views