Usman
Usman
Explore posts from servers
DTDrizzle Team
Created by Aidan Laycock on 8/11/2023 in #help
Issue with Jest tests in Next.js
No description
9 replies
CC#
Created by Usman on 5/17/2024 in #help
Mutation IsLoading remains true in (Phetch library)
I am using this library called Phetch with Blazor Server - https://github.com/Jcparkyn/phetch/ Above is my code. The API request is sent properly, I recieve reponse. But for some reason, IsLoading remains true after triggering
2 replies
DTDrizzle Team
Created by Usman on 12/23/2023 in #help
Multiple records with same columns and values - using joins
I fixed it. For people who wonder how, this is is my query now
const fd1 = db
.select({ moduleDId: fieldd.moduleDId, fieldValue: fieldd.fieldValue })
.from(fieldd)
.where(eq(fieldd.fieldTId, 28))
.as("fd1");
const fd2 = db
.select({ moduleDId: fieldd.moduleDId, fieldValue: fieldd.fieldValue })
.from(fieldd)
.where(eq(fieldd.fieldTId, 29))
.as("fd2");
const fd3 = db
.select({ moduleDId: fieldd.moduleDId, fieldValue: fieldd.fieldValue })
.from(fieldd)
.where(eq(fieldd.fieldTId, 30))
.as("fd3");

const cd = db
.select({ id: categoryd.id, formDId: categoryd.formDId })
.from(categoryd)
.where(eq(categoryd.categoryTId, 26))
.as("cd");

const result = await tx
.select({
// ...
})
.from(inspectionBookings)
.innerJoin(users, eq(users.id, inspectionBookings.assignedDroneOperator))
.innerJoin(
organizations,
eq(organizations.id, inspectionBookings.organization),
)
.innerJoin(droneForms, eq(droneForms.booking, inspectionBookings.id))
.innerJoin(formd, eq(formd.droneFormId, droneForms.id))
.innerJoin(cd, eq(cd.formDId, formd.id))
.innerJoin(moduled, eq(moduled.categoryDId, cd.id))
.innerJoin(fd1, eq(fd1.moduleDId, moduled.id))
.innerJoin(fd2, eq(fd2.moduleDId, moduled.id))
.innerJoin(fd3, eq(fd3.moduleDId, moduled.id))
.orderBy(desc(inspectionBookings.createdAt))
.offset(offset)
.limit(10);
const fd1 = db
.select({ moduleDId: fieldd.moduleDId, fieldValue: fieldd.fieldValue })
.from(fieldd)
.where(eq(fieldd.fieldTId, 28))
.as("fd1");
const fd2 = db
.select({ moduleDId: fieldd.moduleDId, fieldValue: fieldd.fieldValue })
.from(fieldd)
.where(eq(fieldd.fieldTId, 29))
.as("fd2");
const fd3 = db
.select({ moduleDId: fieldd.moduleDId, fieldValue: fieldd.fieldValue })
.from(fieldd)
.where(eq(fieldd.fieldTId, 30))
.as("fd3");

const cd = db
.select({ id: categoryd.id, formDId: categoryd.formDId })
.from(categoryd)
.where(eq(categoryd.categoryTId, 26))
.as("cd");

const result = await tx
.select({
// ...
})
.from(inspectionBookings)
.innerJoin(users, eq(users.id, inspectionBookings.assignedDroneOperator))
.innerJoin(
organizations,
eq(organizations.id, inspectionBookings.organization),
)
.innerJoin(droneForms, eq(droneForms.booking, inspectionBookings.id))
.innerJoin(formd, eq(formd.droneFormId, droneForms.id))
.innerJoin(cd, eq(cd.formDId, formd.id))
.innerJoin(moduled, eq(moduled.categoryDId, cd.id))
.innerJoin(fd1, eq(fd1.moduleDId, moduled.id))
.innerJoin(fd2, eq(fd2.moduleDId, moduled.id))
.innerJoin(fd3, eq(fd3.moduleDId, moduled.id))
.orderBy(desc(inspectionBookings.createdAt))
.offset(offset)
.limit(10);
3 replies
DTDrizzle Team
Created by Usman on 12/23/2023 in #help
Multiple records with same columns and values - using joins
const result = await db
.select()
.from(inspectionBookings)
.innerJoin(users, eq(users.id, inspectionBookings.assignedDroneOperator))
.innerJoin(
organizations,
eq(organizations.id, inspectionBookings.organization)
)
.innerJoin(droneForms, eq(droneForms.booking, inspectionBookings.id))
.innerJoin(formd, eq(formd.droneFormId, droneForms.id))
.innerJoin(categoryd, eq(categoryd.formDId, formd.id))
.innerJoin(moduled, eq(moduled.categoryDId, categoryd.id))
.innerJoin(fieldd, eq(fieldd.moduleDId, moduled.id))
.orderBy(desc(inspectionBookings.createdAt))
.where(eq(categoryd.categoryTId, 26))
.offset(offset)
.limit(10)
const result = await db
.select()
.from(inspectionBookings)
.innerJoin(users, eq(users.id, inspectionBookings.assignedDroneOperator))
.innerJoin(
organizations,
eq(organizations.id, inspectionBookings.organization)
)
.innerJoin(droneForms, eq(droneForms.booking, inspectionBookings.id))
.innerJoin(formd, eq(formd.droneFormId, droneForms.id))
.innerJoin(categoryd, eq(categoryd.formDId, formd.id))
.innerJoin(moduled, eq(moduled.categoryDId, categoryd.id))
.innerJoin(fieldd, eq(fieldd.moduleDId, moduled.id))
.orderBy(desc(inspectionBookings.createdAt))
.where(eq(categoryd.categoryTId, 26))
.offset(offset)
.limit(10)
Here's the query/code
3 replies
CC#
Created by Usman on 10/31/2022 in #help
How to pass custom arguments to MAUI button click
I'll do it and let u know
7 replies
CC#
Created by Usman on 10/31/2022 in #help
How to pass custom arguments to MAUI button click
I am using that itself but haven;t made the UI yet
7 replies