Back to list

Prisma ORM Queries

Lv.5636@mukitaro13 playsDec 28, 2025

Prisma ORM with TypeScript. Next-generation Node.js ORM.

preview.ts
TypeScript
1import { PrismaClient } from '@prisma/client';
2
3const prisma = new PrismaClient();
4
5async function main() {
6 const user = await prisma.user.create({
7 data: {
8 email: 'alice@example.com',
9 name: 'Alice',
10 posts: {
11 create: {
12 title: 'Hello World',
13 content: 'My first post'
14 }
15 }
16 },
17 include: { posts: true }
18 });
19
20 const users = await prisma.user.findMany({
21 where: {
22 email: { contains: '@example.com' }
23 },
24 orderBy: { createdAt: 'desc' },
25 take: 10
26 });
27
28 console.log(users);
29}
30
31main()
32 .catch(console.error)
33 .finally(() => prisma.$disconnect());

Custom problems are not included in rankings