Skip to content

Commit ce2c6a9

Browse files
committed
relationLoadStrategy の指定を削除
1 parent de5ee4b commit ce2c6a9

File tree

4 files changed

+1
-11
lines changed

4 files changed

+1
-11
lines changed

server/src/database/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ export const prisma = new PrismaClient(
3232
prisma.$on("query", (e) => {
3333
console.log(format(e.query, { language: "postgresql" }));
3434
console.log(`Params: ${e.params}`);
35-
console.log(`d湯レーション: ${e.duration}`);
35+
console.log(`Duration: ${e.duration}`);
3636
console.log("\n");
3737
});

server/src/database/courses.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { prisma } from "./client";
55
export async function getCourseByCourseId(courseId: string): Promise<Course> {
66
return (
77
(await prisma.course.findUnique({
8-
relationLoadStrategy: "join",
98
where: {
109
id: courseId,
1110
},
@@ -21,7 +20,6 @@ export async function getCourseByCourseId(courseId: string): Promise<Course> {
2120
*/
2221
export async function getCoursesByUserId(userId: UserID): Promise<Course[]> {
2322
return await prisma.course.findMany({
24-
relationLoadStrategy: "join",
2523
where: {
2624
enrollments: {
2725
some: {
@@ -45,7 +43,6 @@ export async function getCourseByDayPeriodAndUserId(
4543
): Promise<Course | null> {
4644
// TODO: findUnique で取れるような制約を掛ける
4745
return await prisma.course.findFirst({
48-
relationLoadStrategy: "join",
4946
where: {
5047
enrollments: {
5148
some: {
@@ -73,7 +70,6 @@ export async function getCoursesByDayAndPeriod(
7370
period: number,
7471
): Promise<Course[]> {
7572
return await prisma.course.findMany({
76-
relationLoadStrategy: "join",
7773
where: {
7874
slots: {
7975
some: {

server/src/database/requests.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export async function getPendingRequestsToUser(
103103
userId: UserID,
104104
): Promise<UserWithCoursesAndSubjects[]> {
105105
const found = await prisma.user.findMany({
106-
relationLoadStrategy: "join",
107106
where: {
108107
sendingUsers: {
109108
some: {
@@ -147,7 +146,6 @@ export async function getPendingRequestsFromUser(
147146
userId: UserID,
148147
): Promise<UserWithCoursesAndSubjects[]> {
149148
const found = await prisma.user.findMany({
150-
relationLoadStrategy: "join",
151149
where: {
152150
receivingUsers: {
153151
some: {
@@ -192,7 +190,6 @@ export async function getMatchedUser(
192190
userId: UserID,
193191
): Promise<UserWithCoursesAndSubjects[]> {
194192
const found = await prisma.user.findMany({
195-
relationLoadStrategy: "join",
196193
where: {
197194
OR: [
198195
{

server/src/database/users.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export async function createUser(partialUser: Omit<User, "id">): Promise<User> {
2323
// ユーザーの取得
2424
export async function getUser(guid: GUID): Promise<UserWithCoursesAndSubjects> {
2525
const user = await prisma.user.findUnique({
26-
relationLoadStrategy: "join",
2726
where: {
2827
guid: guid,
2928
},
@@ -76,7 +75,6 @@ export async function getUserByID(
7675
id: UserID,
7776
): Promise<UserWithCoursesAndSubjects> {
7877
const user = await prisma.user.findUnique({
79-
relationLoadStrategy: "join",
8078
where: {
8179
id,
8280
},
@@ -142,7 +140,6 @@ export async function getAllUsers(): Promise<
142140
(User & { courses: Course[]; interestSubjects: InterestSubject[] })[]
143141
> {
144142
const users = await prisma.user.findMany({
145-
relationLoadStrategy: "join",
146143
include: {
147144
enrollments: {
148145
include: {

0 commit comments

Comments
 (0)