From a05461d7ae86a458a5adc4dfcc145685aeb10393 Mon Sep 17 00:00:00 2001 From: WATAHIKI YUTO Date: Tue, 4 Nov 2025 10:40:40 +0900 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E8=A4=87=E3=81=97=E3=81=9F=E9=9D=9E?= =?UTF-8?q?=E5=90=8C=E6=9C=9F=E5=87=A6=E7=90=86=E3=81=AB=E9=96=A2=E3=81=99?= =?UTF-8?q?=E3=82=8Btip=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/3-web-servers/08-database/index.mdx | 11 +---------- src/components/Term/definitions.js | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/docs/3-web-servers/08-database/index.mdx b/docs/3-web-servers/08-database/index.mdx index c3360408..a57e6d2f 100644 --- a/docs/3-web-servers/08-database/index.mdx +++ b/docs/3-web-servers/08-database/index.mdx @@ -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つのメソッドは、**非同期処理**を行います。JavaScriptにおける非同期処理とは、ファイルの入出力やネットワーク通信など、JavaScriptの外側の時間のかかる処理の完了を待つ間、ほかの処理を実行できるようにする仕組みです。非同期処理を行う関数を使用するためには、次の2つを行います。 - -- 非同期処理を行う関数を呼び出す関数を定義する際、`async`キーワードをつけること -- 非同期処理を行う関数の戻り値に対し、`await`演算子を適用すること - -非同期処理に関する詳細は、[MDNの記事](https://developer.mozilla.org/ja/docs/Learn/JavaScript/Asynchronous)を参照してください。 - -::: +これら3つのメソッドは、非同期処理を行います。 まずは、`findMany`メソッドの戻り値を、デバッガを用いて確認してみましょう。 diff --git a/src/components/Term/definitions.js b/src/components/Term/definitions.js index c8d39e22..1655c05d 100644 --- a/src/components/Term/definitions.js +++ b/src/components/Term/definitions.js @@ -414,7 +414,7 @@ export default { name: "非同期処理", definition: "処理を実行する際、その完了を待たずに呼び出し元の処理が続行されるような処理。JavaScriptでは、asyncキーワードをつけた関数は非同期処理を行うための関数となり、内部ではawaitキーワードにより他の非同期処理を呼び出してその結果を待機できるようになる。", - referencePage: "/docs/web-servers/database/", + referencePage: "/docs/web-servers/fetch-api/", }, thread: { name: "スレッド",