Last active
May 24, 2021 15:39
-
-
Save Romakita/03951ebfab709cab3f6216fdf5747afb to your computer and use it in GitHub Desktop.
Prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, OnInit, OnDestroy } from "@tsed/common"; | |
import { PrismaClient } from "@prisma/client"; | |
@Injectable() | |
export class PrismaService extends PrismaClient implements OnInit, OnDestroy { | |
async $onInit() { | |
await this.$connect(); | |
} | |
async $onDestroy() { | |
await this.$disconnect(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment