Skip to content
Discussion options

You must be logged in to vote

Hi @rdrigos 👋

To work with multiple databases, you can create separate schema files for each database. In each schema file, you define the datasource with the respective database connection string. Here's an example of how you can set up your schema files:
For Database 1, create a schema file prisma/db-1/schema.prisma:

datasource db {
  provider = "sqlserver"
  url      = env("DATABASE_URL_DB_1")
}

generator client {
  provider        = "prisma-client-js"
  output          = "../../node_modules/@prisma-db-1/client"
}

For Database 2, create a schema file prisma/db-2/schema.prisma:

datasource db {
  provider = "sqlserver"
  url      = env("DATABASE_URL_DB_2")
}

generator client {
  provider

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
11 replies
@rdrigos
Comment options

@simibruda
Comment options

@ludralph
Comment options

@simibruda
Comment options

@IArnaut2
Comment options

Answer selected by rdrigos
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants