20 lines
365 B
TypeScript
20 lines
365 B
TypeScript
import { PrismaClient } from "@prisma/client"
|
|
|
|
const prisma = new PrismaClient()
|
|
|
|
const main = async () => {
|
|
const user = await prisma.user.create({
|
|
data: {
|
|
name: "Alice",
|
|
email: "alice@example.com",
|
|
},
|
|
})
|
|
console.log(user)
|
|
const users = await prisma.user.findMany()
|
|
console.log(users)
|
|
}
|
|
|
|
main().then(() => {
|
|
prisma.$disconnect()
|
|
})
|