mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
- A Next.js starter app using [Prisma Postgres](https://www.prisma.io/postgres) and Prisma ORM This PR adds a new example demonstrating how to integrate Prisma ORM with a Next.js application. The example includes: - Setup instructions for Prisma Postgres - Example models and queries - Basic CRUD operations using Prisma --------- Co-authored-by: Nikolas <[email protected]> Co-authored-by: Alex Martin <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
27 lines
590 B
Plaintext
27 lines
590 B
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
output = "../lib/generated/prisma-client"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
email String @unique
|
|
name String?
|
|
posts Post[]
|
|
}
|
|
|
|
model Post {
|
|
id Int @id @default(autoincrement())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
title String
|
|
content String?
|
|
published Boolean @default(false)
|
|
authorId Int
|
|
author User @relation(fields: [authorId], references: [id])
|
|
} |