0.0.1 • Published 5 months ago

@alphacodez/alphadb v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

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

NameDescriptionDefault
AUTH_DATABASE_URLAuth Database URLpostgresql://user:password@localhost:5432/evoolve_auth
CHAT_DATABASE_URLChat Database URLpostgresql://user:password@localhost:5432/evoolve_chat
DRIVER_DATABASE_URLDriver Database URLpostgresql://user:password@localhost:5432/evoolve_driver
PAYMENT_DATABASE_URLPayment Database URLpostgresql://user:password@localhost:5432/evoolve_payment

License

MIT