Complete the code to import the database client in a Next.js server component.
import [1] from '@/lib/dbClient';
We import the database client to access the database in Next.js server components.
Complete the code to fetch all users from the database using the client.
const users = await dbClient.[1].findMany();The findMany method fetches multiple records from the database.
Fix the error in the code to correctly fetch a user by ID.
const user = await dbClient.user.findUnique({ where: { id: [1] } });The where clause expects the exact field name id with the value to match.
Fill both blanks to create a new user with name and email.
await dbClient.user.create({ data: { name: [1], email: [2] } });We provide string values for name and email inside the data object.
Fill all three blanks to update a user's email by ID.
await dbClient.user.update({ where: { id: [1] }, data: { email: [2] }, select: { [3]: true } });We specify the user ID, new email string, and select the email field to return.
