0.0.1 • Published 5 months ago
@alphacodez/alphadb v0.0.1
How to use
Supported services are: Auth, Chat, Driver, Payment, with their service names in all lowercase.
Install
npm install @evoolv/db-package
Usage
Using the Prisma Client
import { AuthPrismaService } from "@evoolv/db-package";
const authPrismaService = new AuthPrismaService();
await authPrismaService.CheckHealth();
import { AuthPrismaService } from "@evoolv/db-package";
export class AuthService {
constructor(private authPrismaService: AuthPrismaService) {}
async listUsers() {
return await this.authPrismaService.user.findMany();
}
}
Creating Migrations
CREATING MIGRATION FOR ALL SERVICES
npm run make-migration
CREATING MIGRATION FOR A SINGLE SERVICE
npm run make-migration:<service_name>
npm run make-migration:auth
GENERATING PRISMA CLIENT FOR ALL SERVICES
npm run generate
GENERATING PRISMA CLIENT FOR A SINGLE SERVICE
npm run generate:<service_name>
npm run generate:auth
RUNNING MIGRATION FOR ALL SERVICES
npm run migrate
RUNNING MIGRATION FOR A SINGLE SERVICE
npm run migrate:<service_name>
npm run migrate:auth
Environment Variables
Name | Description | Default |
---|---|---|
AUTH_DATABASE_URL | Auth Database URL | postgresql://user:password@localhost:5432/evoolve_auth |
CHAT_DATABASE_URL | Chat Database URL | postgresql://user:password@localhost:5432/evoolve_chat |
DRIVER_DATABASE_URL | Driver Database URL | postgresql://user:password@localhost:5432/evoolve_driver |
PAYMENT_DATABASE_URL | Payment Database URL | postgresql://user:password@localhost:5432/evoolve_payment |
License
MIT
0.0.1
5 months ago