Write a function that letโs you put a todo in the database.
Starter code -
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function createTodo(userId: number, title: string, description: string) {
}
createTodo(1, "go to gym", "go to gym and do 10 pushups");
Write a function to get all the todos for a user. Starter code
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function getTodos(userId: number, ) {
}
getTodos(1);
Write a function that gives you the todo details of a user along with the user details
Starter Code
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function getTodosAndUserDetails(userId: number, ) {
}
getTodosAndUserDetails(1);
๐ก
See https://github.com/prisma/prisma/issues/5026 to log the actual SQL queries