Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate PrismaClient instance for each fabbrica file #257

Merged
merged 3 commits into from Jan 15, 2024

Conversation

Quramy
Copy link
Owner

@Quramy Quramy commented Jan 15, 2024

It closes #246

This PRs allows to initialize multiple Prisma clients

/* seed.ts */

import { PrismaClient as ClientA } from "./client-a";
import { PrismaClient as ClientB } from "./client-b";

import { initialize as initalizeA } from "./fabbrica-a";
import { initialize as initalizeB } from "./fabbrica-b";

async function main() {
  inializeA({ prisma: new ClientA() });
  inializeB({ prisma: new ClientB() });

  // ...execute factory corresponding A and B
}

main();

@Quramy Quramy changed the title Feature/isolate prisma instance Isolate PrismaClient instance for each fabbrica file Jan 15, 2024
@Quramy Quramy merged commit d1101c9 into main Jan 15, 2024
1 check passed
@Quramy Quramy deleted the feature/isolate_prisma_instance branch January 15, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple databases support
1 participant