Skip to content

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

Open
chelproc wants to merge 25 commits into
mainfrom
update-prisma-to-latest-version
Open

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

Conversation

@chelproc

@chelproc chelproc commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

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

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

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3d7fccb
Status: ✅  Deploy successful!
Preview URL: https://cc6d6189.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

@chvmvd chvmvd left a comment

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/new-postgresql-instance.mp4
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
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
Comment thread docs/3-web-servers/08-database/index.mdx
Comment thread docs/3-web-servers/08-database/prisma-init.mp4
@chvmvd

chvmvd commented May 2, 2026

Copy link
Copy Markdown
Contributor

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

Comment thread docs/3-web-servers/08-database/index.mdx
@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
@chelproc

Copy link
Copy Markdown
Contributor Author

#961 を cherry-pick

@chelproc
chelproc requested review from Yokomi422 and chvmvd June 13, 2026 05:33
Comment thread docs/3-web-servers/08-database/index.mdx Outdated
Comment thread docs/3-web-servers/08-database/new-postgresql-instance.mp4
Comment thread docs/3-web-servers/08-database/index.mdx
Comment thread docs/3-web-servers/08-database/index.mdx
Comment thread docs/3-web-servers/08-database/index.mdx Outdated
@chvmvd

chvmvd commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

^

@chelproc
chelproc force-pushed the update-prisma-to-latest-version branch from 652dabc to 57dbffc Compare July 19, 2026 04:58
@chelproc

Copy link
Copy Markdown
Contributor Author

残置された課題は別 issue にしました。

@chelproc
chelproc requested a review from chvmvd July 19, 2026 06:36

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 on lines 135 to 148
:::tip[環境変数]
データベースへの接続情報は、プログラム内に直接記述するのではなく、<Term>**環境変数**</Term>を用いて指定することが一般的です。環境変数は、アプリケーションの実行時に、アプリケーション自体を変更することなく外側から動作を変更するために用いることができる仕組みで、キーと値の組み合わせによって定義されます。環境変数は、主に次のような情報をプログラム内に記述することを避けるために用いられます。

- 機密情報
- 環境ごとに異なる設定情報

アプリケーションの実行時に環境変数を指定するには、コマンドの前に`KEY=VALUE`の形式の文字列を記述します。例えば、ターミナル上で次のコマンドを実行すると、`main.js`では、[`process.env.DATABASE_URL`を通して](https://nodejs.org/ja/learn/command-line/how-to-read-environment-variables-from-nodejs)環境変数`DATABASE_URL`の値を取得できます。

```shell
DATABASE_URL=postgresql://user:password@example.com:5432/db node main.js
```

`.env`ファイルは、環境変数の指定を簡略化するために慣習的に用いられるファイルです。`node --env-file=.env main.js`のように指定することで、`.env`ファイルに記述された環境変数を読み込ませることができます。なお、Prismaは`.env`ファイルの内容を自動的に読み込むため、`--env-file`オプションを指定する必要はありません
`.env`ファイルは、環境変数の指定を簡略化するために慣習的に用いられるファイルです。`node --env-file=.env main.js`のように指定することで、`.env`ファイルに記述された環境変数を読み込ませることができます。`npx prisma init`コマンドを実行したときに作成される`prisma.config.ts`ファイルには、`dotenv`パッケージを用いて`.env`ファイルを読み込むコードが記述されているため、Prismaのコマンドを実行する際には、`.env`ファイルに記述された環境変数が自動的に読み込まれるようになっています
:::

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.

この説明をdotenvパッケージについての説明から遠い場所で行う必要はあるのでしょうか?dotenvパッケージについてここで触れたしばらく後に、dotenvパッケージのtipがあるのは少し分かりづらい気がするのですが。

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.

Prisma 6.18.0への対応

4 participants