Prisma Package Entry Point (index.ts
)
This file serves as the main entry point for the @sodacore/core
Prisma integration package. It re-exports the primary plugin, service, and Prisma client, making them available for import from a single location. The default export is the PrismaPlugin
for easy integration with the Sodacore application.
Features
- Centralized Exports: Exposes the Prisma plugin, service, and client for easy import.
- Default Plugin Export: Exports
PrismaPlugin
as the default, enabling quick registration with the Sodacore application. - Service and Client Exports: Exports the
PrismaService
for lifecycle management and thePrismaClient
for direct database access.
Usage
Import Prisma integration features directly from the package root:
typescript
import PrismaPlugin, {
PrismaService,
PrismaClient,
} from '@sodacore/core/prisma';
Register the plugin with your Sodacore application:
typescript
import PrismaPlugin from '@sodacore/core/prisma';
app.register(PrismaPlugin);
API
Default Export
- PrismaPlugin The main plugin class for integrating Prisma ORM with the Sodacore application.
Named Exports
PrismaService: Manages the lifecycle of the Prisma client (init, start, stop).
PrismaClient: The Prisma ORM client for direct database queries.
Notes
- This file is intended to be the single import point for all Prisma features in the Sodacore ecosystem.
- All exports are organized for clarity and ease of use, supporting both application and library development.