Creates an instance of the PrismaService.
Optional
options: PrismaClientOptionsOptional configuration options for PrismaClient.
prisma.permission
: Exposes CRUD operations for the Permission model.
prisma.role
: Exposes CRUD operations for the Role model.
prisma.user
: Exposes CRUD operations for the User model.
Executes a prepared raw query and returns the number of affected rows.
Rest
...values: any[]const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`
Read more in our docs.
Executes a raw query and returns the number of affected rows. Susceptible to SQL injections, see documentation.
Rest
...values: any[]const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
Read more in our docs.
Performs a prepared raw query and returns the SELECT
data.
Rest
...values: any[]const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`
Read more in our docs.
Performs a raw query and returns the SELECT
data.
Susceptible to SQL injections, see documentation.
Rest
...values: any[]const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
Read more in our docs.
Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
Optional
options: { Optional
isolationconst [george, bob, alice] = await prisma.$transaction([
prisma.user.create({ data: { name: 'George' } }),
prisma.user.create({ data: { name: 'Bob' } }),
prisma.user.create({ data: { name: 'Alice' } }),
])
Read more in our docs.
Optional
options: { Optional
isolationOptional
maxOptional
timeout?: numberGenerated using TypeDoc
Injectable service that extends PrismaClient and provides access to the Prisma ORM.
Name
PrismaService
Implements