Static
$clientStatic
$connectStatic
$disconnectDisconnect from the database
Static
$executeExecutes a prepared raw query and returns the number of affected rows.
const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'[email protected]'};`
Read more in our docs.
Static
$executeExecutes a raw query and returns the number of affected rows. Susceptible to SQL injections, see documentation.
const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, '[email protected]')
Read more in our docs.
Static
$extendsStatic
$queryPerforms a prepared raw query and returns the SELECT
data.
const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'[email protected]'};`
Read more in our docs.
Static
$queryPerforms a raw query and returns the SELECT
data.
Susceptible to SQL injections, see documentation.
const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, '[email protected]')
Read more in our docs.
Static
$transactionAllows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
Optional
options: {}const [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.
Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
Optional
options: {}const [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.
Static
aggregateStatic
countStatic
createStatic
createStatic
createStatic
deleteStatic
deleteStatic
fieldsStatic
findStatic
findStatic
findStatic
findStatic
findStatic
groupStatic
updateStatic
updateStatic
upsert
Connect with the database