K
Kysely7mo ago
Saif

Webstorm warning with multiple joins

const organizationsWithAdminUser = await db
.selectFrom("organizations")
.innerJoin("groups", "groups.organization_id", "organizations.id")
.innerJoin("users_groups", "users_groups.group_id", "groups.id")
.innerJoin("users", "users.id", "users_groups.user_id")
.where("users.id", "=", userId)
.where("groups.name", "=", "Admin")
.selectAll("organizations")
.execute();
const organizationsWithAdminUser = await db
.selectFrom("organizations")
.innerJoin("groups", "groups.organization_id", "organizations.id")
.innerJoin("users_groups", "users_groups.group_id", "groups.id")
.innerJoin("users", "users.id", "users_groups.user_id")
.where("users.id", "=", userId)
.where("groups.name", "=", "Admin")
.selectAll("organizations")
.execute();
Is this the right way to write multiple inner joins? Let me know if you'd like me to show the types.
No description
No description
2 Replies
koskimas
koskimas7mo ago
What do you mean by "the right way"?
Saif
Saif7mo ago
I mean it works, and the query is right too. But am I missing something and due to which I am getting this warning, or is it just webstorm acting up?
Want results from more Discord servers?
Add your server