1. createTodo

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");

2. getTodos

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);

3. getTodosAndUserDetails (Does/should it use joins?)

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