Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 1 addition & 10 deletions docs/3-web-servers/08-database/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,7 @@ Node.jsからPrismaを利用してデータベースのデータを操作する
- [`PrismaClient#[テーブル名].findFirst`メソッド](https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#findfirst): 条件を満たす最初のレコードを取得
- [`PrismaClient#[テーブル名].findUnique`メソッド](https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#findunique): レコードを一意に識別できる条件を使用してレコードを1つだけ取得

:::tip[非同期処理]

上記の3つのメソッドは、<Term>**非同期処理**</Term>を行います。JavaScriptにおける非同期処理とは、ファイルの入出力やネットワーク通信など、JavaScriptの外側の時間のかかる処理の完了を待つ間、ほかの処理を実行できるようにする仕組みです。非同期処理を行う関数を使用するためには、次の2つを行います。

- 非同期処理を行う関数を呼び出す関数を定義する際、`async`キーワードをつけること
- 非同期処理を行う関数の戻り値に対し、`await`演算子を適用すること

非同期処理に関する詳細は、[MDNの記事](https://developer.mozilla.org/ja/docs/Learn/JavaScript/Asynchronous)を参照してください。

:::
これら3つのメソッドは、<Term>非同期処理</Term>を行います。

まずは、`findMany`メソッドの戻り値を、デバッガを用いて確認してみましょう。

Expand Down
2 changes: 1 addition & 1 deletion src/components/Term/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export default {
name: "非同期処理",
definition:
"処理を実行する際、その完了を待たずに呼び出し元の処理が続行されるような処理。JavaScriptでは、asyncキーワードをつけた関数は非同期処理を行うための関数となり、内部ではawaitキーワードにより他の非同期処理を呼び出してその結果を待機できるようになる。",
referencePage: "/docs/web-servers/database/",
referencePage: "/docs/web-servers/fetch-api/",
},
thread: {
name: "スレッド",
Expand Down