Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5e801f5
Prisma のバージョンを最新にアップデート
chelproc Mar 21, 2026
2e79eda
Prisma v7 に合わせて「データベース」の節の本文を更新
chelproc Mar 21, 2026
f8b1408
Supabase と Prisma の最新バージョンで動画等を更新
chelproc Apr 29, 2026
9bab7d9
スペース削除
chelproc Apr 29, 2026
d07cf07
SQLの説明を修正
chelproc May 9, 2026
a16d437
Supabaseの最新のUIに追従
chelproc May 9, 2026
ae1cdad
--save-dev を -D に修正, オプションの説明を集約
chelproc May 9, 2026
88c4770
文章のミスを修正
chelproc May 9, 2026
401060e
本文のテーブル名を修正
chelproc May 9, 2026
9bde384
サンプルを最新の Prisma で動作するよう修正
chelproc May 9, 2026
95edf7b
prisma-client-js が deprecated のため prisma-client に移行
chelproc May 9, 2026
b66ed9b
docs: use express.json in database chapter sample
Copilot Jun 8, 2026
616f827
不足していた express を追加
chelproc Jun 13, 2026
5e46d75
npx prisma generate コマンドに関する記述を追加
chelproc Jun 13, 2026
7bcac9a
update prisma-init.mp4
chelproc Jun 13, 2026
fb53130
prisma generate の動画を追加
chelproc Jun 13, 2026
540a304
dotenv パッケージについての記述を追加
chelproc Jun 13, 2026
3669476
find-many, create のスクリーンショットを修正, 単複の問題を修正
chelproc Jun 13, 2026
7e33e12
prisma.config.ts についての説明を微修正
chelproc Jun 13, 2026
50a341d
TypeScript の文章の崩れを修正
chelproc Jun 13, 2026
8520b83
importFileExtension が不要になったとのことで削除
chelproc Jun 13, 2026
c64720c
演習問題に npx prisma generate に関する記述を追加
chelproc Jun 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/3-web-servers/08-database/_samples/forum/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/node_modules
/.env
node_modules
# Keep environment variables out of version control
.env

/generated/prisma
12 changes: 8 additions & 4 deletions docs/3-web-servers/08-database/_samples/forum/main.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import "dotenv/config";
import express from "express";
import { PrismaClient } from "./generated/prisma/index.js";
import { PrismaPg } from "@prisma/adapter-pg";
import { PrismaClient } from "./generated/prisma/client.ts";

const app = express();
const client = new PrismaClient();
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });
const prisma = new PrismaClient({ adapter: adapter });

app.use(express.json());
app.use(express.static("./public"));

app.get("/posts", async (request, response) => {
const posts = await client.post.findMany();
const posts = await prisma.post.findMany();
response.json(posts);
});

app.post("/posts", async (request, response) => {
await client.post.create({ data: { message: request.body.message } });
await prisma.post.create({ data: { message: request.body.message } });
response.sendStatus(201); // Created(新しいメッセージを作成)
});

Expand Down
Loading