1// Find all posts2const allPosts: Post[] = await prisma.post.findMany()
1// Find a user by ID2const userById: User | null = await prisma.user.findUnique({3 where: {4 id: 2,5 },6})
1// Find a user by email2const userByEmail = await prisma.user.findUnique({3 where: {4 email: '[email protected]',5 },6})
1// Find the first user that contains Ada2const userByName = await prisma.user.findFirst({3 where: {4 name: {5 contains: 'Ada',6 },7 },8})
1// Select specific fields2const userName = await prisma.user.findUnique({3 where: {4 email: '[email protected]',5 },6 select: {7 name: true,8 email: true,9 },10})