Skip to content

Prisma のバージョンを最新にアップデート#946

Open
chelproc wants to merge 11 commits intomainfrom
update-prisma-to-latest-version
Open

Prisma のバージョンを最新にアップデート#946
chelproc wants to merge 11 commits intomainfrom
update-prisma-to-latest-version

Conversation

@chelproc
Copy link
Copy Markdown
Contributor

@chelproc chelproc commented Mar 21, 2026

Prisma のバージョンを v7 にアップデート
自動生成ファイルが TypeScript ベースになったが、Node.js v22.18 のアップデートにより、問題なく使えるようになった。

https://nodejs.org/en/learn/typescript/run-natively

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 21, 2026

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 95edf7b
Status: ✅  Deploy successful!
Preview URL: https://1bb509b6.utcode-learn.pages.dev
Branch Preview URL: https://update-prisma-to-latest-vers.utcode-learn.pages.dev

View logs

@chelproc chelproc force-pushed the update-prisma-to-latest-version branch 3 times, most recently from ab790cb to a108f20 Compare March 21, 2026 10:44
@chelproc chelproc marked this pull request as ready for review March 21, 2026 11:12
@chelproc chelproc force-pushed the update-prisma-to-latest-version branch from 9e052db to 2e79eda Compare April 12, 2026 06:36
Copy link
Copy Markdown
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

途中までレビューしたのですが、そもそも動作していないような気がします...

![リレーショナルデータベース](./relational-database-concept.png)

リレーショナルデータベースに対するクエリは、通常**SQL**と呼ばれる言語を用いて記述します。データベース<Term>クライアント</Term>として用いるライブラリによっては、SQLを直接用いることなく、そのライブラリが提供する専用の関数等を用いてデータベースに対してクエリを発行できることがあります
リレーショナルデータベースに対するクエリは、多くの場合、**SQL**と呼ばれる言語を用いて記述されます。しかし、SQLは人間が直接記述するための言語であり、プログラム中に直接記述するにはあまり適していません。そのため、データベースへのクエリをプログラムから発行しやすくするための<Term>ライブラリ</Term>が数多く存在しています。その中でも、この節で用いる[Prisma](https://www.prisma.io/)は、Node.jsにおける最も人気のある<Term>ライブラリ</Term>の一つです
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

しかし、SQLは人間が直接記述するための言語であり、プログラム中に直接記述するにはあまり適していません。

ここの表現はあまり正確でなく、誤解を招くように思います。この文だと「SQLはプログラム中に書くものではない」と読めてしまうような気がします。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d07cf07 で修正

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以前の動画では自動生成されたパスワードをメモ帳アプリに保存していましたが、現在の動画ではクリップボードに保存しているだけになっているので、学習者がパスワードを紛失してしまう事例が出てしまいそうな気がします。

Comment thread docs/3-web-servers/08-database/index.mdx Outdated
Comment thread docs/3-web-servers/08-database/index.mdx Outdated
Comment thread docs/3-web-servers/08-database/index.mdx Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここが古い情報のままになっていそうです。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも古い情報のままになっていそうです。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同様


![createの戻り値](./create-result.png)

## 演習問題
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

演習問題の説明がアップデートされていなさそうです。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.jsontypeプロパティの値がmoduleではなく、commonjsになってしまっています。
現在の教材ではpackage.jsonを作成する際に、moduleを選ぶようにしています。
cf.

npmを用いて開発を行うには、まず`npm init`コマンドを実行します。いくつか質問をされるので、`type`と尋ねられた時には`module`と入力し、それ以外の時にはEnterキーを押し続けて質問をスキップしましょう。完了すると、フォルダの中に`package.json`という名前のファイルが作成されます。このファイルは、npmによって管理されるフォルダに必ず1つ必要になるものです。

@chvmvd
Copy link
Copy Markdown
Contributor

chvmvd commented May 2, 2026

「Cookieと認証(発展)」の節でもPrismaを使用しているので、こちらも合わせて修正したいですね 👀

generator client {
provider = "prisma-client-js"
provider = "prisma-client"
output = "../generated/prisma"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx prisma generateとしないと、generatedが生成されない気がする?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ですね。
これ以外にもいろいろと動いていない原因があるので、それを直さないとですね。
「フロントエンドとバックエンドの連携とデプロイ」の節のように書く必要がありそうですね👀

@chelproc chelproc force-pushed the update-prisma-to-latest-version branch from 4e670e1 to 791fb0c Compare May 9, 2026 09:35
@chelproc chelproc force-pushed the update-prisma-to-latest-version branch from 791fb0c to ae1cdad Compare May 9, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants